Commit 9211f91f 9211f91fdf1081ae404a318fdfbd1553571b41fb by Chris Lorenzo

Change clientutils to be able to set a global scope

1 parent 5ed461e8
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
57 57
58 // public members 58 // public members
59 this.options = options || {}; 59 this.options = options || {};
60 60 this.options.scope = this.options.scope || document;
61 /** 61 /**
62 * Clicks on the DOM element behind the provided selector. 62 * Clicks on the DOM element behind the provided selector.
63 * 63 *
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
243 * @return NodeList|undefined 243 * @return NodeList|undefined
244 */ 244 */
245 this.findAll = function findAll(selector, scope) { 245 this.findAll = function findAll(selector, scope) {
246 scope = scope || document; 246 scope = scope || this.options.scope;
247 try { 247 try {
248 var pSelector = this.processSelector(selector); 248 var pSelector = this.processSelector(selector);
249 if (pSelector.type === 'xpath') { 249 if (pSelector.type === 'xpath') {
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
264 * @return HTMLElement|undefined 264 * @return HTMLElement|undefined
265 */ 265 */
266 this.findOne = function findOne(selector, scope) { 266 this.findOne = function findOne(selector, scope) {
267 scope = scope || document; 267 scope = scope || this.options.scope;
268 try { 268 try {
269 var pSelector = this.processSelector(selector); 269 var pSelector = this.processSelector(selector);
270 if (pSelector.type === 'xpath') { 270 if (pSelector.type === 'xpath') {
......