v1.18.x
psychobunny 10 years ago
parent e0c7ef1451
commit 046bcef800

@ -31,15 +31,19 @@ define('admin/extend/widgets', function() {
connectToSortable: ".widget-area" connectToSortable: ".widget-area"
}); });
$('#widgets .available-containers .containers > [data-container-html]').draggable({ $('#widgets .available-containers .containers > [data-container-html]')
helper: function(e) { .draggable({
var target = $(e.target); helper: function(e) {
target = target.attr('data-container-html') ? target : target.parents('[data-container-html]'); var target = $(e.target);
target = target.attr('data-container-html') ? target : target.parents('[data-container-html]');
return target.clone().addClass('block').width(target.width()).css('opacity', '0.5');
}, return target.clone().addClass('block').width(target.width()).css('opacity', '0.5');
distance: 10 },
}); distance: 10
})
.each(function() {
$(this).attr('data-container-html', $(this).attr('data-container-html').replace(/\\\{([\s\S]*?)\\\}/, '{$1}'));
});
$('#widgets .widget-area').sortable({ $('#widgets .widget-area').sortable({
update: function (event, ui) { update: function (event, ui) {

Loading…
Cancel
Save