diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js index 89fba34c4b..c76fea0c9a 100644 --- a/public/src/forum/admin/themes.js +++ b/public/src/forum/admin/themes.js @@ -162,7 +162,7 @@ define('forum/admin/themes', ['forum/admin/settings'], function(Settings) { Themes.prepareWidgets = function() { $('[data-location="drafts"]').insertAfter($('[data-location="drafts"]').closest('.tab-content')); - + $('#widgets .available-widgets .panel').draggable({ helper: function(e) { return $(e.target).parents('.panel').clone().addClass('block').width($(e.target.parentNode).width()); @@ -298,20 +298,18 @@ define('forum/admin/themes', ['forum/admin/settings'], function(Settings) { $.get(RELATIVE_PATH + '/api/admin/themes', function(data) { var areas = data.areas; - for (var a in areas) { - if (areas.hasOwnProperty(a)) { - var area = areas[a], - widgetArea = $('#widgets .area[data-template="' + area.template + '"][data-location="' + area.location + '"]').find('.widget-area'); + for(var i=0; i
')); - } else if (location === 'sidebar') { + } else if (location === 'sidebar' && !$('#content [widget-area="sidebar"]').length) { $('#content > *').wrapAll($('
')); $('#content').append($('
')); - } else if (location === 'header') { + } else if (location === 'header' && !$('#content [widget-area="header"]').length) { $('#content').prepend($('
')); }