From 341a0c8190b33e9dbcc1d590e1a4cd36db8c18c5 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sun, 20 Jul 2014 14:35:16 -0400 Subject: [PATCH] closes #1855 --- public/src/forum/admin/themes.js | 24 +++++++++++------------- public/src/widgets.js | 8 ++++---- 2 files changed, 15 insertions(+), 17 deletions(-) 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($('
')); }