From 1f5d14dda442f9113daa1efe0fc1edcd72b32134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ch=E1=BA=BF=20Ti=E1=BB=87p=20Ch=C3=A2n=20Khoa?= Date: Fri, 29 Sep 2017 20:27:41 +0700 Subject: [PATCH] place some code under the right loop (#5945) --- public/src/widgets.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/public/src/widgets.js b/public/src/widgets.js index 082b291624..badc55c892 100644 --- a/public/src/widgets.js +++ b/public/src/widgets.js @@ -23,21 +23,21 @@ widgetsAtLocation.forEach(function (widget) { html += widget.html; + }); - if (location === 'footer' && !$('#content [widget-area="footer"]').length) { - $('#content').append($('
')); - } else if (location === 'sidebar' && !$('#content [widget-area="sidebar"]').length) { - if ($('[component="account/cover"]').length) { - $('[component="account/cover"]').nextAll().wrapAll($('
')); - } else if ($('[component="groups/cover"]').length) { - $('[component="groups/cover"]').nextAll().wrapAll($('
')); - } else { - $('#content > *').wrapAll($('
')); - } - } else if (location === 'header' && !$('#content [widget-area="header"]').length) { - $('#content').prepend($('
')); + if (location === 'footer' && !$('#content [widget-area="footer"]').length) { + $('#content').append($('
')); + } else if (location === 'sidebar' && !$('#content [widget-area="sidebar"]').length) { + if ($('[component="account/cover"]').length) { + $('[component="account/cover"]').nextAll().wrapAll($('
')); + } else if ($('[component="groups/cover"]').length) { + $('[component="groups/cover"]').nextAll().wrapAll($('
')); + } else { + $('#content > *').wrapAll($('
')); } - }); + } else if (location === 'header' && !$('#content [widget-area="header"]').length) { + $('#content').prepend($('
')); + } area = $('#content [widget-area="' + location + '"]'); if (html && area.length) {