opal-virtual-dom 0.2.2 → 0.2.3

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: 57554d40a88560a6b23e6c7ba6751e6a36dad42e
4
- data.tar.gz: a0166e2405f201db96c50901e38f1fe8b6e94623
3
+ metadata.gz: c3b99baf852b0d8f5e170531a65ac3cc2b100855
4
+ data.tar.gz: 9b7296c8436cc57c33d1a6c60982f2544228d4ae
5
5
  SHA512:
6
- metadata.gz: 04564e3b0be679cad37b6df21bf8f61a830317498470d4763d0d25f815a2815e7cdc9be061797bcc2faedfa8e906a53d49e1b9d092cbfae6efe01aefd94e5f9f
7
- data.tar.gz: f98d7f3d76306c5599a1567a7591c6cfc98a62c1cf03c959be77e40f0932feda1c998d03ad0edadf520615b742bb057666d1ac9a589afc596d084c8114cd8432
6
+ metadata.gz: f26ad07b31759990f20dbafbf12659f8003b63bd02c43bd367386cc93698b30675fb9df781e72bd1fcf202c2b942e98962f2b622a4e6c2f60adf8fec9570b7cd
7
+ data.tar.gz: c066ad3a5fc5b336aa6790461ebac81fa6e58b97c3b4ffc77a6d355725fa83ef50f205fcbf018525bbb1f5b4a14c0a18dd20d0daba5dae19c82486625902706b
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'opal-virtual-dom'
3
- s.version = '0.2.2'
3
+ s.version = '0.2.3'
4
4
  s.authors = [ 'Michał Kalbarczyk' ]
5
5
  s.email = 'fazibear@gmail.com'
6
6
  s.homepage = 'http://github.com/fazibear/opal-virtual-dom'
@@ -32,13 +32,31 @@ module VirtualDOM
32
32
  case k
33
33
  when 'class'
34
34
  params['className'] = params.delete('class')
35
+ when 'data'
36
+ params['dataset'] = params.delete('data')
37
+ when 'default'
38
+ params['defaultValue'] = params.delete('default')
35
39
  when /^on/
36
- params[k] = ->(e) { v.call(Native(e)) }
40
+ params[k] = event_callback(v)
37
41
  end
38
42
  end
39
43
  params
40
44
  end
41
45
 
46
+ if defined?(Browser::Event)
47
+ def event_callback(v)
48
+ proc do |e|
49
+ v.call(Browser::Event.new(e))
50
+ end
51
+ end
52
+ else
53
+ def event_callback(v)
54
+ proc do |e|
55
+ v.call(Native(e))
56
+ end
57
+ end
58
+ end
59
+
42
60
  # for backwards compatibility, you can return string
43
61
  def text(string)
44
62
  @__virtual_nodes__ << string.to_s
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-virtual-dom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Kalbarczyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-21 00:00:00.000000000 Z
11
+ date: 2015-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal