client/js/renderer/nodeshowbutton.js
author ymh <ymh.work@gmail.com>
Tue, 10 Jan 2017 17:36:30 +0100
changeset 649 2b9c120dba55
parent 553 d05ee3bcceab
permissions -rw-r--r--
first implementation of node title size and color


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

    var Utils = requtils.getUtils();

    /* NodeRemoveButton Begin */

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

    _(NodeShowButton.prototype).extend({
        _init: function() {
            this.type = "Node-show-button";
            this.lastSectorInner = 0;
            this.startAngle = 90;
            this.endAngle = 135;
            this.imageName = "show";
            this.text = "Show neighbors";
        },
        mouseup: function() {
            this.renderer.click_target = null;
            this.renderer.is_dragging = false;
            this.renderer.removeRepresentationsOfType("editor");
            if (this.renderer.isEditable()) {
                this.source_representation.showNeighbors(false);
            }
        }
    }).value();

    /* NodeShowButton End */

    return NodeShowButton;

});