Node.js based forum software built for the modern web
place some code under the right loop (#5945)
Chế Tiệp Chân Khoa1f5d14dda442
diff --git a/public/src/widgets.js b/public/src/widgets.jsindex 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($('<div class="row"><div widget-area="footer" class="col-xs-12"></div></div>'));- } else if (location === 'sidebar' && !$('#content [widget-area="sidebar"]').length) {- if ($('[component="account/cover"]').length) {- $('[component="account/cover"]').nextAll().wrapAll($('<div class="row"><div class="col-lg-9 col-xs-12"></div><div widget-area="sidebar" class="col-lg-3 col-xs-12"></div></div></div>'));- } else if ($('[component="groups/cover"]').length) {- $('[component="groups/cover"]').nextAll().wrapAll($('<div class="row"><div class="col-lg-9 col-xs-12"></div><div widget-area="sidebar" class="col-lg-3 col-xs-12"></div></div></div>'));- } else {- $('#content > *').wrapAll($('<div class="row"><div class="col-lg-9 col-xs-12"></div><div widget-area="sidebar" class="col-lg-3 col-xs-12"></div></div></div>'));- }- } else if (location === 'header' && !$('#content [widget-area="header"]').length) {- $('#content').prepend($('<div class="row"><div widget-area="header" class="col-xs-12"></div></div>'));+ if (location === 'footer' && !$('#content [widget-area="footer"]').length) {+ $('#content').append($('<div class="row"><div widget-area="footer" class="col-xs-12"></div></div>'));+ } else if (location === 'sidebar' && !$('#content [widget-area="sidebar"]').length) {+ if ($('[component="account/cover"]').length) {+ $('[component="account/cover"]').nextAll().wrapAll($('<div class="row"><div class="col-lg-9 col-xs-12"></div><div widget-area="sidebar" class="col-lg-3 col-xs-12"></div></div></div>'));+ } else if ($('[component="groups/cover"]').length) {+ $('[component="groups/cover"]').nextAll().wrapAll($('<div class="row"><div class="col-lg-9 col-xs-12"></div><div widget-area="sidebar" class="col-lg-3 col-xs-12"></div></div></div>'));+ } else {+ $('#content > *').wrapAll($('<div class="row"><div class="col-lg-9 col-xs-12"></div><div widget-area="sidebar" class="col-lg-3 col-xs-12"></div></div></div>'));}- });+ } else if (location === 'header' && !$('#content [widget-area="header"]').length) {+ $('#content').prepend($('<div class="row"><div widget-area="header" class="col-xs-12"></div></div>'));+ }area = $('#content [widget-area="' + location + '"]');if (html && area.length) {