Skip to content

Instantly share code, notes, and snippets.

@bagobor
Created October 29, 2012 14:46
Show Gist options
  • Save bagobor/3973950 to your computer and use it in GitHub Desktop.
Save bagobor/3973950 to your computer and use it in GitHub Desktop.
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