diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js index 37180be94b..f80159fc00 100644 --- a/public/src/forum/admin/themes.js +++ b/public/src/forum/admin/themes.js @@ -135,18 +135,34 @@ define(['forum/admin/settings'], function(Settings) { } Themes.prepareWidgets = function() { - $('#widgets .panel').draggable({ + $('#widgets .available-widgets .panel').draggable({ helper: function(e) { return $(e.target).parents('.panel').clone().addClass('block').width($(e.target.parentNode).width()); }, connectToSortable: ".widget-area" }); + $('#widgets .available-containers .containers > [data-container]').draggable({ + helper: function(e) { + var target = $(e.target); + target = target.attr('data-container') ? target : target.parents('[data-container]'); + + return target.clone().addClass('block').width(target.width()).css('opacity', '0.5'); + } + }); + function appendToggle(el) { if (!el.hasClass('block')) { el.addClass('block') + .droppable({ + drop: function(event, ui) { + $(this).find('.panel-heading small').html(ui.draggable.attr('data-container')); + }, + hoverClass: "panel-info" + }) .children('.panel-heading') - .append('