client/js/renderer/nodeeditbutton.js
author ymh <ymh.work@gmail.com>
Fri, 16 May 2014 09:23:11 +0200
changeset 290 8a6eb26ac87f
parent 284 fa8035885814
child 293 fba23fde14ba
permissions -rw-r--r--
move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.

"use strict";

define(['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
    
    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();
            }
        }
    });

    /* NodeEditButton End */
    
    return NodeEditButton;

});