client/js/renderer/nodeenlargebutton.js
author rougeronj
Wed, 20 May 2015 10:53:40 +0200
changeset 451 278f8da09c04
parent 434 0d5998b32a7c
child 453 04b7d46e9d67
permissions -rw-r--r--
Add retro-compatibility with previous model - If no "hidden_nodes attributes in the previous view, we set the current HiddenNodes to an empty array



define(['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
    'use strict';

    var Utils = requtils.getUtils();

    /* NodeEnlargeButton Begin */

    //var NodeEnlargeButton = Renderer.NodeEnlargeButton = Utils.inherit(Renderer._NodeButton);
    var NodeEnlargeButton = Utils.inherit(NodeButton);

    _(NodeEnlargeButton.prototype).extend({
        _init: function() {
            this.type = "Node-enlarge-button";
            this.lastSectorInner = 0;
            this.startAngle = -45;
            this.endAngle = 0;
            this.imageName = "enlarge";
            this.text = "Enlarge";
        },
        mouseup: function() {
            var _newsize = 1 + (this.source_representation.model.get("size") || 0);
            this.source_representation.model.set("size", _newsize);
            this.source_representation.select();
            this.select();
            paper.view.draw();
        }
    }).value();

    /* NodeEnlargeButton End */

    return NodeEnlargeButton;

});