Widget constructor saves $(node) as the new jqnode member.
authorMike Taylor <mike@indexdata.com>
Thu, 15 May 2014 10:12:09 +0000 (11:12 +0100)
committerMike Taylor <mike@indexdata.com>
Thu, 15 May 2014 10:12:09 +0000 (11:12 +0100)
Use w.jqnode in place of $(w.node) in a couple of places.

src/mkws-widget.js

index 464d2b4..a201424 100644 (file)
@@ -10,6 +10,7 @@ function widget($, team, type, node) {
     team: team,
     type: type,
     node: node,
+    jqnode: $(node),
     config: mkws.objectInheritingFrom(team.config())
   };
 
@@ -121,10 +122,10 @@ widget.autosearch = function(widget) {
 // 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.jqnode.hide();
   });
   widget.team.queue("resize-wide").subscribe(function(n) {
-    $(widget.node).show();
+    widget.jqnode.show();
   });
 };