Created
October 29, 2012 14:46
-
-
Save bagobor/3973950 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drag: function (e, ui){ | |
var thiz = this; | |
/* this.$el.css({ | |
left: thiz.$el.data('left'), | |
top: thiz.$el.data('top') | |
});*/ | |
if(this.isSelected){ | |
_.each(this.relative.selected, function (id){ | |
var item = this.relative.items[id]; | |
//if(item == this) return; | |
var deltaLeft = parseFloat(thiz.$el.css('left')) - parseFloat(item.$el.css('left')); | |
var deltaTop = parseFloat(thiz.$el.css('top')) - parseFloat(item.$el.css('top')); | |
var left = ui.position.left / this.relative.scale - deltaLeft; | |
var top = ui.position.top / this.relative.scale - deltaTop; | |
jsLog.write('test'); | |
item.$el.css({ | |
left: left, | |
top: top | |
}); | |
/*item.moveLines(false, { | |
position: { | |
left: left, | |
top: top | |
} | |
});*/ | |
}, this); | |
} | |
/* | |
this.$el.data({ | |
left: ui.position.left / this.relative.scale, | |
top: ui.position.top / this.relative.scale | |
}); | |
this.moveLines(e, ui);*/ | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment