302b5fff by Michael Richards

Merge branch 'zepto-support'

2 parents 5471cb20 17d85126
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
12 # The Rivets namespace. 12 # The Rivets namespace.
13 Rivets = {} 13 Rivets = {}
14 14
15 # jQuery || Zepto
16 jQuery = window.jQuery or window.Zepto
17
15 # Polyfill For `String::trim`. 18 # Polyfill For `String::trim`.
16 unless String::trim then String::trim = -> @replace /^\s+|\s+$/g, '' 19 unless String::trim then String::trim = -> @replace /^\s+|\s+$/g, ''
17 20
...@@ -236,7 +239,7 @@ class Rivets.View ...@@ -236,7 +239,7 @@ class Rivets.View
236 # constructor along with any local options that should be used throughout the 239 # constructor along with any local options that should be used throughout the
237 # context of the view and it's bindings. 240 # context of the view and it's bindings.
238 constructor: (@els, @models, @options = {}) -> 241 constructor: (@els, @models, @options = {}) ->
239 @els = [@els] unless (@els.jquery || @els instanceof Array) 242 @els = [@els] if typeof @els.length is 'undefined'
240 243
241 for option in ['config', 'binders', 'formatters'] 244 for option in ['config', 'binders', 'formatters']
242 @[option] = {} 245 @[option] = {}
......