equal
deleted
inserted
replaced
56 }, |
56 }, |
57 /* Drawing an edit box with an arrow and positioning the edit box according to the position of the node/edge being edited |
57 /* Drawing an edit box with an arrow and positioning the edit box according to the position of the node/edge being edited |
58 * Called by Rkns.Renderer.NodeEditor and Rkns.Renderer.EdgeEditor */ |
58 * Called by Rkns.Renderer.NodeEditor and Rkns.Renderer.EdgeEditor */ |
59 drawEditBox = function(_options, _coords, _path, _xmargin, _selector) { |
59 drawEditBox = function(_options, _coords, _path, _xmargin, _selector) { |
60 _selector.css({ |
60 _selector.css({ |
61 width: ( _options.tooltip_width - 2* _options.tooltip_padding ), |
61 width: ( _options.tooltip_width - 2* _options.tooltip_padding ) |
62 }); |
62 }); |
63 var _height = _selector.outerHeight() + 2* _options.tooltip_padding, |
63 var _height = _selector.outerHeight() + 2* _options.tooltip_padding, |
64 _isLeft = (_coords.x < paper.view.center.x ? 1 : -1), |
64 _isLeft = (_coords.x < paper.view.center.x ? 1 : -1), |
65 _left = _coords.x + _isLeft * ( _xmargin + _options.tooltip_arrow_length ), |
65 _left = _coords.x + _isLeft * ( _xmargin + _options.tooltip_arrow_length ), |
66 _right = _coords.x + _isLeft * ( _xmargin + _options.tooltip_arrow_length + _options.tooltip_width ), |
66 _right = _coords.x + _isLeft * ( _xmargin + _options.tooltip_arrow_length + _options.tooltip_width ), |
642 this.text = $('<div class="Rk-Label Rk-Edge-Label">').appendTo(this.renderer.labels_$); |
642 this.text = $('<div class="Rk-Label Rk-Edge-Label">').appendTo(this.renderer.labels_$); |
643 this.arrow_angle = 0; |
643 this.arrow_angle = 0; |
644 if (this.options.editor_mode) { |
644 if (this.options.editor_mode) { |
645 this.normal_buttons = [ |
645 this.normal_buttons = [ |
646 new EdgeEditButton(this.renderer, null), |
646 new EdgeEditButton(this.renderer, null), |
647 new EdgeRemoveButton(this.renderer, null), |
647 new EdgeRemoveButton(this.renderer, null) |
648 ]; |
648 ]; |
649 this.pending_delete_buttons = [ |
649 this.pending_delete_buttons = [ |
650 new EdgeRevertButton(this.renderer, null) |
650 new EdgeRevertButton(this.renderer, null) |
651 ]; |
651 ]; |
652 this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons); |
652 this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons); |
1659 mouseup: function(_event) { |
1659 mouseup: function(_event) { |
1660 _event.preventDefault(); |
1660 _event.preventDefault(); |
1661 _this.onMouseUp(_event, false); |
1661 _this.onMouseUp(_event, false); |
1662 }, |
1662 }, |
1663 mousewheel: function(_event, _delta) { |
1663 mousewheel: function(_event, _delta) { |
1664 _event.preventDefault(); |
1664 if(_renkan.options.zoom_on_scroll) { |
1665 if (_allowScroll) { |
1665 _event.preventDefault(); |
1666 _this.onScroll(_event, _delta); |
1666 if (_allowScroll) { |
|
1667 _this.onScroll(_event, _delta); |
|
1668 } |
1667 } |
1669 } |
1668 }, |
1670 }, |
1669 touchstart: function(_event) { |
1671 touchstart: function(_event) { |
1670 _event.preventDefault(); |
1672 _event.preventDefault(); |
1671 var _touches = _event.originalEvent.touches[0]; |
1673 var _touches = _event.originalEvent.touches[0]; |