From d0e86555c3ee3c865c04dc05f44942b328c13c97 Mon Sep 17 00:00:00 2001 From: Lewis Wright Date: Wed, 14 Sep 2016 20:47:10 +0100 Subject: [PATCH] Allow overriding of selectors in the constructor --- source/list.coffee | 2 +- source/widget.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/list.coffee b/source/list.coffee index 1a9b4fe..b2b5b6f 100644 --- a/source/list.coffee +++ b/source/list.coffee @@ -9,7 +9,7 @@ class List extends Widget constructor: (selector, itemSelector, driver, widget) -> super selector, driver @Widget = widget ? Widget - @itemSelector ?= itemSelector + @itemSelector = itemSelector if itemSelector? @_nestedItemsSelector = "#{@selector} #{@itemSelector}" @widgets = @_wrapAsWidgets(@driver.elements(@_nestedItemsSelector).value) diff --git a/source/widget.coffee b/source/widget.coffee index f796bf8..d407152 100644 --- a/source/widget.coffee +++ b/source/widget.coffee @@ -21,7 +21,7 @@ class Widget extends Base selector: null constructor: (selector, @driver=driver.api) -> - @selector ?= selector + @selector = selector if selector? if not typeof @selector is 'string' throw new Error "Invalid selector given: #{@selector}"