client/js/renderer/nodeshowbutton.js
author rougeronj
Wed, 30 Sep 2015 16:32:21 +0200
changeset 555 49daeea94e88
parent 553 d05ee3bcceab
permissions -rw-r--r--
New library to handle fullscreen : screenfull.js


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;

});