tao_on_rails 0.6.11 → 0.6.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ee0098ae40b3400b415b4615047a90522ecfaf5
4
- data.tar.gz: dff1d86e3944afceba47c15e47bc0795a7326b70
3
+ metadata.gz: 10be715fb0bd91375e156634cdb8438681e4eb0a
4
+ data.tar.gz: 3f96fe46d35eef70468d5c63f4fcb094e9dc6e3c
5
5
  SHA512:
6
- metadata.gz: a9b3a656668072f506c08fd464f05f5d99daa208a72ad35be415cdc5553f51242a6cc6815abe1272ca13a341d8b6b62a8aee89036c4c7bbbfcbc3d0456970875
7
- data.tar.gz: 646e3864a0e727dfd77baf6a5fc0ce8841eeb6f22350166ceaf3ab2d06df8c8506c752cc63615d53a7cb309e54b22f07db7ce4c19d4a5e9360babfdda6718f9a
6
+ metadata.gz: 50d9a416c16e433f44d6e0e60ea58772200a89bc1179fa40f4bb94c1eb0fde9c9107153203a6ccb46bb3be13c235b5d5372b3dc426c13df1eabb17d215d4297a
7
+ data.tar.gz: 2c8789ab457163c3a9cb61f5b34b8b03bd91bd03dc122a46d0f3169b720015098d2519520414157383d08b69f89f5e4bdf1373e992567584fa1c04088c159667
@@ -50,6 +50,17 @@ class TaoModule
50
50
  @_proterties[name] = val
51
51
  @["_#{name}Changed"]?()
52
52
 
53
+ @_options: []
54
+
55
+ @option: (names..., options = {}) ->
56
+ unless typeof options == 'object'
57
+ names.push(options)
58
+ options = {}
59
+
60
+ names.forEach (name) =>
61
+ @_options.push(name) unless name in @_options
62
+ @property name, options
63
+
53
64
  @aliasMethod: (newMethod, oldMethod) ->
54
65
  @::[newMethod] = ->
55
66
  @[oldMethod]?.apply(@, arguments)
@@ -58,8 +69,9 @@ class TaoModule
58
69
  @id = ++id
59
70
  @_proterties = {}
60
71
 
61
- if typeof options == 'object'
62
- @[key] = val for key, val of options
72
+ if _.isObject options
73
+ for key, val of options
74
+ @[key] = val if key in @constructor._options
63
75
 
64
76
  @_init()
65
77
 
@@ -1,3 +1,3 @@
1
1
  module TaoOnRails
2
- VERSION = "0.6.11"
2
+ VERSION = "0.6.12"
3
3
  end
@@ -66,5 +66,3 @@ E.default.Element_insertAdjacentElement?f(Element.prototype,E.default.Element_in
66
66
  */
67
67
  var N=window.customElements;if(window.MutationObserver&&(!N||N.forcePolyfill||"function"!=typeof N.define||"function"!=typeof N.get)){var O=new w.default;H.default(O);J.default(O);K.default(O);M.default(O);document.__CE_hasRegistry=!0;var P=new C.default(O);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:P})};
68
68
  }).call(self);
69
-
70
- //# sourceMappingURL=custom-elements.min.js.map
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tao_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11
4
+ version: 0.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siyuan Liu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-08 00:00:00.000000000 Z
12
+ date: 2017-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: turbolinks