Abstract all-widgets selector out into new function selectorForAllWidgets
authorMike Taylor <mike@indexdata.com>
Thu, 8 May 2014 14:13:23 +0000 (15:13 +0100)
committerMike Taylor <mike@indexdata.com>
Thu, 8 May 2014 14:13:23 +0000 (15:13 +0100)
src/mkws-core.js

index 4c9db87..8abdeda 100644 (file)
@@ -427,8 +427,12 @@ mkws.pagerNext = function(tname) {
   }
 
 
+  function selectorForAllWidgets() {
+    return '[class^="mkws"],[class*=" mkws"]';
+  }
+
   function makeWidgetsWithin(level, node) {
-    node.find('[class^="mkws"],[class*=" mkws"]').each(function() {
+    node.find(selectorForAllWidgets()).each(function() {
       handleNodeWithTeam(this, function(tname, type) {
         var myTeam = mkws.teams[tname];
         if (!myTeam) {