client/js/renderer/nodehidebutton.js
author rougeronj
Wed, 03 Jun 2015 17:27:46 +0200
changeset 471 e0c7be5dc02c
parent 453 04b7d46e9d67
child 507 fe71fdbc6663
permissions -rw-r--r--
Add a router to handle fragment identifier Set up a listener of the router in the scene to update it Start Backbone.history (eventlistener of the router) when all the project is loaded Include router.js to all the test file
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
449
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     1
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     2
define(['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     3
    'use strict';
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     4
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     5
    var Utils = requtils.getUtils();
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     6
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     7
    /* NodeRemoveButton Begin */
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     8
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
     9
    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    10
    var NodeHideButton = Utils.inherit(NodeButton);
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    11
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    12
    _(NodeHideButton.prototype).extend({
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    13
        _init: function() {
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    14
            this.type = "Node-hide-button";
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    15
            this.lastSectorInner = 0;
453
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents: 449
diff changeset
    16
            this.startAngle = 45;
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents: 449
diff changeset
    17
            this.endAngle = 90;
449
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    18
            this.imageName = "hide";
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    19
            this.text = "Hide";
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    20
        },
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    21
        mouseup: function() {
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    22
            this.renderer.click_target = null;
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    23
            this.renderer.is_dragging = false;
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    24
            this.renderer.removeRepresentationsOfType("editor");
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    25
            if (this.renderer.isEditable()) {
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    26
                this.renderer.addHiddenNode(this.source_representation.model);
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    27
            }
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    28
        }
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    29
    }).value();
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    30
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    31
    /* NodeRemoveButton End */
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    32
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    33
    return NodeHideButton;
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    34
aae670254c49 add a hidebutton to the nodes buttons
rougeronj
parents:
diff changeset
    35
});