From 6e42dcabd11c2e8ab8980e35e0ce0167fd402ed7 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 8 May 2014 15:49:38 +0100 Subject: [PATCH] The selectorForAllWidgets function now returns the old scanning selector if the "scan_all_nodes" configuration element is set, but otherwise the new class-based selector that Jason prefers. --- src/mkws-core.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mkws-core.js b/src/mkws-core.js index 8abdeda..79e95e9 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -428,9 +428,21 @@ mkws.pagerNext = function(tname) { function selectorForAllWidgets() { - return '[class^="mkws"],[class*=" mkws"]'; + if (mkws.config.scan_all_nodes) { + log("scanning selector"); + return '[class^="mkws"],[class*=" mkws"]'; + } else { + log("class-based selector"); + var s = ""; + for (var type in mkws.widgetType2function) { + if (s) s += ','; + s += '.mkws' + type; + } + return s; + } } + function makeWidgetsWithin(level, node) { node.find(selectorForAllWidgets()).each(function() { handleNodeWithTeam(this, function(tname, type) { -- 1.7.10.4