mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 07:58:34 +02:00
Support dragging the goal window
This commit is contained in:
parent
549e67b1c7
commit
f29252e6ad
5 changed files with 182 additions and 36 deletions
|
@ -74,6 +74,13 @@ var Visualization = Backbone.View.extend({
|
|||
this.myResize();
|
||||
}, this));
|
||||
|
||||
// If the visualization is within a draggable container, we need to update the
|
||||
// position whenever the container is moved.
|
||||
this.$el.parents('.ui-draggable').on('drag', _.bind(function(event, ui) {
|
||||
this.customEvents.trigger('drag', event, ui);
|
||||
this.myResize();
|
||||
}, this));
|
||||
|
||||
this.gitVisuals.drawTreeFirstTime();
|
||||
if (this.treeString) {
|
||||
this.gitEngine.loadTreeFromString(this.treeString);
|
||||
|
@ -182,12 +189,14 @@ var Visualization = Backbone.View.extend({
|
|||
$(this.paper.canvas).css('visibility', 'visible');
|
||||
setTimeout(_.bind(this.fadeTreeIn, this), 10);
|
||||
this.originToo('show', arguments);
|
||||
this.myResize();
|
||||
},
|
||||
|
||||
showHarsh: function() {
|
||||
$(this.paper.canvas).css('visibility', 'visible');
|
||||
this.setTreeOpacity(1);
|
||||
this.originToo('showHarsh', arguments);
|
||||
this.myResize();
|
||||
},
|
||||
|
||||
resetFromThisTreeNow: function(treeString) {
|
||||
|
@ -257,8 +266,8 @@ var Visualization = Backbone.View.extend({
|
|||
// if we don't have a container, we need to set our
|
||||
// position absolutely to whatever we are tracking
|
||||
if (!this.containerElement) {
|
||||
var left = el.offsetLeft;
|
||||
var top = el.offsetTop;
|
||||
var left = this.$el.offset().left;
|
||||
var top = this.$el.offset().top;
|
||||
|
||||
$(this.paper.canvas).css({
|
||||
position: 'absolute',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue