client/js/renderer/nodeeditbutton.js
author rougeronj
Wed, 20 May 2015 10:39:35 +0200
changeset 450 88e8673aaeeb
parent 434 0d5998b32a7c
child 453 04b7d46e9d67
permissions -rw-r--r--
add the hidden/ghost behaviour: - The view hide or show the nodes calling their functions hide() or show(ghost). - The node and the edges have the attributes 'hidden' and 'ghost' to properly redraw them selves.


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

    var Utils = requtils.getUtils();

    /* NodeEditButton Begin */

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

    _(NodeEditButton.prototype).extend({
        _init: function() {
            this.type = "Node-edit-button";
            this.lastSectorInner = 0;
            this.startAngle = -135;
            this.endAngle = -45;
            this.imageName = "edit";
            this.text = "Edit";
        },
        mouseup: function() {
            if (!this.renderer.is_dragging) {
                this.source_representation.openEditor();
            }
        }
    }).value();

    /* NodeEditButton End */

    return NodeEditButton;

});