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('
 
'); + .append('
 
') + .children('small').html(''); } } diff --git a/public/templates/admin/themes.tpl b/public/templates/admin/themes.tpl index 861dbaee37..22d423c844 100644 --- a/public/templates/admin/themes.tpl +++ b/public/templates/admin/themes.tpl @@ -54,25 +54,7 @@

Widgets

-
-

Available Widgets

-
- -
-
- {widgets.name} {widgets.description} -
- -
- -
-
- -
+

{areas.name} {areas.template} / {areas.location}

@@ -82,6 +64,45 @@
+
+
+

Available Widgets

+
+ +
+
+ {widgets.name} {widgets.description} +
+ +
+ +
+
+ +
+

Available Containers

+
+
+ None +
+
+ Well +
+
+
+ Panel Header +
+
+ Panel Body +
+
+
+
+