From fb95a1c0ae9ea20d05326b7edec857fbef1714ef Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 28 May 2014 15:37:35 +0100 Subject: [PATCH] The hideWhenNarrow function is now a member of the widget object, so it's invoked as w.hideWhenNarrow() rather than widget.hideWhenNarrow(w) --- src/mkws-widget.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/mkws-widget.js b/src/mkws-widget.js index f6c2e2e..ca8b12d 100644 --- a/src/mkws-widget.js +++ b/src/mkws-widget.js @@ -126,6 +126,17 @@ function widget($, team, type, node) { } }; + // Utility function for all widgets that want to hide in narrow windows + that.hideWhenNarrow = function() { + var widget = this; + widget.team.queue("resize-narrow").subscribe(function(n) { + widget.node.hide(); + }); + widget.team.queue("resize-wide").subscribe(function(n) { + widget.node.show(); + }); + }; + for (var i = 0; i < node.attributes.length; i++) { var a = node.attributes[i]; @@ -164,16 +175,3 @@ function widget($, team, type, node) { return that; } - - -// Utility function for all widgets that want to hide in narrow windows -widget.hideWhenNarrow = function(widget) { - widget.team.queue("resize-narrow").subscribe(function(n) { - widget.node.hide(); - }); - widget.team.queue("resize-wide").subscribe(function(n) { - widget.node.show(); - }); -}; - - -- 1.7.10.4