Widget edition : snapping optimized (only snap to widgets within activated tabs)

+ added jquery-ui resizable snap plugin
This commit is contained in:
jean-emmanuel 2016-02-15 11:30:46 +01:00
parent cc1e403428
commit 2426dfdbdf
3 changed files with 167 additions and 2 deletions

View file

@ -70,7 +70,9 @@ enableEditor = function(){
data.height = Math.max(ui.size.height,30)
data.width = Math.max(ui.size.width,30)
updateWidget()
}
},
snap:'.tab.on .widget, .tab.on',
snapTolerance:5
})
$(this).draggable({
@ -82,7 +84,7 @@ enableEditor = function(){
updateWidget()
},
handle:'.ui-draggable-handle',
snap:'.widget, .tab',
snap:'.tab.on .widget, .tab.on',
snapTolerance:5,
helper:function(){return $('<div class="ui-helper"></div>').css({height:$(this).outerHeight(),width:$(this).outerWidth()})}
// containment:'parent'

File diff suppressed because one or more lines are too long