prevent absolute positionning of widgets within strips
This commit is contained in:
parent
515036dc89
commit
7af190a9a6
4 changed files with 27 additions and 18 deletions
File diff suppressed because one or more lines are too long
|
|
@ -60,9 +60,8 @@ enableEditor = function(){
|
|||
|
||||
}
|
||||
|
||||
$('.widget.ui-resizable').resizable('destroy')
|
||||
$('.widget.ui-draggable').draggable('destroy').find('.ui-draggable-handle').remove()
|
||||
|
||||
$('.widget.ui-resizable').resizable('destroy')
|
||||
$(this).resizable({
|
||||
handles:'se',
|
||||
helper: "ui-helper",
|
||||
|
|
@ -75,25 +74,30 @@ enableEditor = function(){
|
|||
snapTolerance:5
|
||||
})
|
||||
|
||||
$(this).draggable({
|
||||
stop: function( event, ui ) {
|
||||
event.preventDefault()
|
||||
data.top = ui.helper.position().top + $(this).parent().scrollTop()
|
||||
data.left = ui.helper.position().left + $(this).parent().scrollLeft()
|
||||
ui.helper.remove()
|
||||
updateWidget()
|
||||
},
|
||||
handle:'.ui-draggable-handle',
|
||||
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'
|
||||
}).append('<div class="ui-draggable-handle"></div>')
|
||||
if (data.hasOwnProperty('top')) {
|
||||
$('.widget.ui-draggable').draggable('destroy').find('.ui-draggable-handle').remove()
|
||||
$(this).draggable({
|
||||
stop: function( event, ui ) {
|
||||
event.preventDefault()
|
||||
data.top = ui.helper.position().top + $(this).parent().scrollTop()
|
||||
data.left = ui.helper.position().left + $(this).parent().scrollLeft()
|
||||
ui.helper.remove()
|
||||
updateWidget()
|
||||
},
|
||||
handle:'.ui-draggable-handle',
|
||||
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'
|
||||
}).append('<div class="ui-draggable-handle"></div>')
|
||||
}
|
||||
|
||||
for (i in widgetOptions[data.type]) {
|
||||
if (i.indexOf('separator')!=-1) {
|
||||
$(`<div class="separator"><span>${widgetOptions[data.type][i]}</span></div>`).appendTo(form)
|
||||
continue
|
||||
} else if (data[i]===undefined) {
|
||||
continue
|
||||
}
|
||||
if (i!='widgets' && i!='tabs') {
|
||||
var type = typeof data[i],
|
||||
|
|
|
|||
|
|
@ -105,6 +105,11 @@ parsewidgets = function(widgets,parent) {
|
|||
widgetData[t] = `${widgetData[t]}`.indexOf('-')!=-1?0:widgetData[t]
|
||||
}
|
||||
|
||||
if (parent.hasClass('strip')) {
|
||||
delete widgetData.top
|
||||
delete widgetData.left
|
||||
}
|
||||
|
||||
var width = parseInt(widgetData.width)==widgetData.width?parseInt(widgetData.width)+'rem' : widgetData.width,
|
||||
height = parseInt(widgetData.height)==widgetData.height?parseInt(widgetData.height)+'rem' : widgetData.height,
|
||||
left = parseInt(widgetData.left)==widgetData.left?parseInt(widgetData.left)+'rem' : widgetData.left,
|
||||
|
|
|
|||
|
|
@ -1370,7 +1370,7 @@ a {
|
|||
.fader-wrapper-outer {
|
||||
position: relative;
|
||||
top:auto;
|
||||
padding-bottom: 35rem;
|
||||
padding-bottom: 30rem;
|
||||
height: 100%;
|
||||
.fader-wrapper {
|
||||
padding:20rem 20rem 50rem;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue