conjoin 0.0.19 → 0.0.20

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: fdddf77340beb4f24a208132eaa58cdafae4c6f6
4
- data.tar.gz: 52b6fa8267f22c02ac5c01fb513612feb9af8789
3
+ metadata.gz: e248e80cf3cd06a0fcce465bbc553bfb668cf282
4
+ data.tar.gz: 0643883e98f7053f640f6831872749889f253702
5
5
  SHA512:
6
- metadata.gz: 29f932eeeb17c07991e7ebd77cbdd8091156e2d6c032c28e362a33fcc33a43920be25f361c5c6eab572c4b08c78970a4e7dc230eea41e09dfdb1d8cb9a2f46d5
7
- data.tar.gz: e64485dbd7400d924e84182196d44546a3810f56f5ecd792ab321364005bfc552f9d829a0fd23dd64b26e9d630c80d704749262ffffb11e9d03027673c897ab7
6
+ metadata.gz: 2baa2ffa1b09b441371e5bcde0097a9d6da505118bb1791a6963661e765d17784cd0b1a09fd888a6bdaee036cd307c84554a5263c315b01d5f36bce847ff38a0
7
+ data.tar.gz: ae9f1b7b9076fefcb4087e3b9d655855c89aa2d37e2b03a6751d5722511898987d3d2581aed7e857b6cac856d0c2f615fb5d2a8ecc5305aa89dfd7fc6dd26487
@@ -13,7 +13,11 @@ module Conjoin
13
13
  end
14
14
 
15
15
  def display
16
+ # We don't need the type
17
+ options.delete :type
18
+
16
19
  append_button = options.delete :append_button
20
+
17
21
  if options[:multiple]
18
22
  options[:name] += '[]'
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module Conjoin
2
- VERSION = "0.0.19"
2
+ VERSION = "0.0.20"
3
3
  end
@@ -211,21 +211,26 @@ module Conjoin
211
211
  js.to_s.gsub(/(\\|<\/|\r\n|\\3342\\2200\\2250|[\n\r"'])/) {|match| JS_ESCAPE[match] }
212
212
  end
213
213
 
214
- def trigger event, data = {}
215
- req.env[:widget_name] = req.params['widget_name']
216
- trigger_event event, req.env[:widget_name], data.to_ostruct
214
+ def trigger t_event, data = {}
215
+ req.env[:loaded_widgets].each do |n, w|
216
+ w.trigger_event t_event, req.params['widget_name'], data.to_ostruct
217
+ end
217
218
  end
218
219
 
219
- def trigger_event event, widget_name, data = {}
220
+ def trigger_event t_event, widget_name, data = {}
220
221
  if events = self.class.events
221
222
  events.each do |class_event, opts|
222
- if class_event == event && (widget_name == folder.to_s or opts[:for].to_s == widget_name)
223
- event = opts[:with] if opts[:with]
223
+ if class_event == t_event && (widget_name == folder.to_s or opts[:for].to_s == widget_name)
224
+ if not opts[:with]
225
+ e = t_event
226
+ else
227
+ e = opts[:with]
228
+ end
224
229
 
225
- if method(event).parameters.length > 0
226
- send(event, data)
230
+ if method(e) and method(e).parameters.length > 0
231
+ send(e, data)
227
232
  else
228
- send(event)
233
+ send(e)
229
234
  end
230
235
  end
231
236
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-23 00:00:00.000000000 Z
11
+ date: 2014-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cuba