dont add dupes to widgetLocations

this prevents widgets from being executed multiple times
This commit is contained in:
barisusakli
2014-04-09 16:35:51 -04:00
parent d61e632c59
commit 34b73e15e6

View File

@@ -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;