mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
dont add dupes to widgetLocations
this prevents widgets from being executed multiple times
This commit is contained in:
@@ -18,7 +18,10 @@
|
||||
var widgetLocations = ['sidebar', 'footer'], numLocations;
|
||||
|
||||
$('#content [widget-area]').each(function() {
|
||||
widgetLocations.push($(this).attr('widget-area'));
|
||||
var location = $(this).attr('widget-area');
|
||||
if ($.inArray(location, widgetLocations) === -1) {
|
||||
widgetLocations.push(location);
|
||||
}
|
||||
});
|
||||
|
||||
numLocations = widgetLocations.length;
|
||||
|
||||
Reference in New Issue
Block a user