seed_tray 0.3.0 → 0.4.0

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: 375d8b0166ba9c0627a8b8191b58d75b9436094d
4
- data.tar.gz: 53f2d85ddcec618f344b3bf4086c9ad5299c4270
3
+ metadata.gz: ac3be306c998f05111f32601b7aca15fa6730e72
4
+ data.tar.gz: ffce0ca76a0027e36b3232b3a157b490a41aecee
5
5
  SHA512:
6
- metadata.gz: 363cfb35d3a270e37de75cbaa918dee58c03f8f2a8a7acfc65d729f0043a8cc25a5e4041d708c46fcd08fea8b8e5a3af4015f07071f8fb8828928492063fb3b7
7
- data.tar.gz: 8b3881a6e6ee5d832b5e2b117f97a24c7cdbea0f702efa25114a8af39618feb05ed772b16927e1d16d6d88e7caa1c0e9d386861d04326b81970aa41621fb9e71
6
+ metadata.gz: ff28957dafc6dbb40853f0b3d33deeaea9107e3595a8054708c193245e8d29178b91042361a5d8b97bd0c809797a4b6081c770dd1ee70a48ab190ebd0a0e6743
7
+ data.tar.gz: e27892161895450b6ee9ec29087846cbaea6250a0c0a82a1b07cf3e0cbd54908227f45ad7958c7104a3968e425ed8502395a51dcc999d4e90b053d0dbbb09173
@@ -4,39 +4,39 @@ class SeedTray
4
4
  constructor: () ->
5
5
  if window.Turbolinks != undefined
6
6
  if Turbolinks.EVENTS != undefined
7
- $(window).on "page:change", => @ready()
7
+ $(window).on "page:change", => @render()
8
8
  else
9
- $(window).on "turbolinks:load", => @ready()
9
+ $(window).on "turbolinks:load", => @render()
10
10
  else
11
- $(@ready)
11
+ $(@render)
12
12
  @root = <%= app_name %>
13
13
 
14
- # Dynamically delegate ready to controller#action specific ready methods
15
- ready: =>
16
- # Run the page specific ready code
17
- @delegate_ready()
14
+ # Dynamically delegate render to controller#action specific render methods
15
+ render: =>
16
+ # Run the page specific render code
17
+ @delegate_render()
18
18
 
19
19
  # Run the code that should run on every page.
20
- @site_wide_ready()
20
+ @site_wide_render()
21
21
 
22
- delegate_ready: =>
22
+ delegate_render: =>
23
23
  controller = $("[data-controller]").data("controller")
24
24
  action = $("[data-action]").data("action")
25
25
 
26
- if @root[controller] && @ready_defined(@root[controller])
27
- @root[controller].ready()
26
+ if @root[controller] && @render_defined(@root[controller])
27
+ @root[controller].render()
28
28
  else
29
- console.info "Skipped #{@root.name}.#{controller}.ready()."
29
+ console.info "Skipped #{@root.name}.#{controller}.render()."
30
30
 
31
- if @root[controller] && @root[controller][action] && @ready_defined(@root[controller][action])
32
- @root[controller][action].ready()
33
- console.info "Executed #{@root.name}.#{controller}.#{action}.ready()."
31
+ if @root[controller] && @root[controller][action] && @render_defined(@root[controller][action])
32
+ @root[controller][action].render()
33
+ console.info "Executed #{@root.name}.#{controller}.#{action}.render()."
34
34
  else
35
- console.info "Skipped #{@root.name}.#{controller}.#{action}.ready()."
35
+ console.info "Skipped #{@root.name}.#{controller}.#{action}.render()."
36
36
 
37
- ready_defined: (object) ->
38
- object.ready != undefined
37
+ render_defined: (object) ->
38
+ object.render != undefined
39
39
 
40
- site_wide_ready: ->
40
+ site_wide_render: ->
41
41
 
42
42
  <%= app_name %>.delegator = new SeedTray()
@@ -1,3 +1,3 @@
1
1
  module SeedTray
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed_tray
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Guenther