client/js/renderer/nodeshowbutton.js
author rougeronj
Tue, 22 Sep 2015 15:14:10 +0200
changeset 543 5f7bebdcfc0d
parent 453 04b7d46e9d67
child 553 d05ee3bcceab
permissions -rw-r--r--
Improve the way we init the view. The data loader send a "loaded" event, hooked by the scene.py and initializing the backbone.history and the view. We don't use redraw_active in save-once and full-json, because it was making the view initialization dependent of these file which are externals. Small fix to hide the "set saved view" button when there is only one view.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
453
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     1
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     2
define(['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     3
    'use strict';
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     4
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     5
    var Utils = requtils.getUtils();
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     6
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     7
    /* NodeRemoveButton Begin */
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     8
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
     9
    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    10
    var NodeShowButton = Utils.inherit(NodeButton);
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    11
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    12
    _(NodeShowButton.prototype).extend({
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    13
        _init: function() {
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    14
            this.type = "Node-show-button";
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    15
            this.lastSectorInner = 0;
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    16
            this.startAngle = 90;
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    17
            this.endAngle = 135;
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    18
            this.imageName = "show";
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    19
            this.text = "Show";
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    20
        },
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    21
        mouseup: function() {
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    22
            this.renderer.click_target = null;
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    23
            this.renderer.is_dragging = false;
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    24
            this.renderer.removeRepresentationsOfType("editor");
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    25
            if (this.renderer.isEditable()) {
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    26
                this.source_representation.showNeighbors(false);
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    27
            }
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    28
        }
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    29
    }).value();
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    30
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    31
    /* NodeShowButton End */
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    32
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    33
    return NodeShowButton;
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    34
04b7d46e9d67 new node's button to show the hidden neighbors
rougeronj
parents:
diff changeset
    35
});