From 924388d96f7302bbdc907ec4891ce6cfdfd64043 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 31 Mar 2014 12:54:27 -0400 Subject: [PATCH] widgets - only collapse / expand divs that specify a target location --- public/src/widgets.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/src/widgets.js b/public/src/widgets.js index f06ec5fcc6..d16f0e27fd 100644 --- a/public/src/widgets.js +++ b/public/src/widgets.js @@ -4,11 +4,13 @@ (function(ajaxify) { ajaxify.widgets = {}; - ajaxify.widgets.reposition = function() { + ajaxify.widgets.reposition = function(location) { $('body [no-widget-class]').each(function() { var $this = $(this); - $this.removeClass(); - $this.addClass($this.attr('no-widget-class')); + if ($this.attr('no-widget-target') === location) { + $this.removeClass(); + $this.addClass($this.attr('no-widget-class')); + } }); }; @@ -51,7 +53,7 @@ area.html(html).removeClass('hidden'); if (!renderedWidgets.length) { - ajaxify.widgets.reposition(); + ajaxify.widgets.reposition(location); } $('#content [widget-area] img:not(.user-img)').addClass('img-responsive');