rails_script 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWZmNTVhNzNhMDMzMmE1MzZjYmQ1OTRmNTU4ZmUzMWFhYzgxMjJiNQ==
4
+ MTYzNzBlZGU0Mjk0OGQxNjIzYzY3OTYzY2IzYTkxZjk3M2NlNjA0Nw==
5
5
  data.tar.gz: !binary |-
6
- MjI1ZjYwNmNkNjM0NjEwYmQwZTdmYjkwMTMzYmUxNDE2MTdhZWE5ZQ==
6
+ NTJmMGJiNDllOTEwNjJhOGI5NzA0YTM3NzlkZjMwYjYyMTIzYmExOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDE2MWI4YjI1N2EwYmFhOTRlN2Q3NzBmN2FkNmE3ZTk5ZTgwZTNiMzNjMTAw
10
- NjVkY2Y5M2RhZWEyZmU0ZWY0NGIwNDVkMTEyNDJhNzA4YWNmN2VlZjFlNDRm
11
- MGYyNThjMGVhZWEyODA3ZjljNmY4OWY1NDdhYzg2M2VkNmY2MTU=
9
+ M2Q4MDY0NjZkMDQ2NGFiNmZkNzRiYmFlYTlmNTU4ZGNlNGUzZGM1ZjM3YTE0
10
+ YmQ1OTBlYmI3ZDM2NDBlMDZjNjI5MGViOTg0MmU1MzRlMTQzODU4NjdlZTJm
11
+ MGRkN2FhNTBiYzg2YjgwOGYzZDMyZTI1YWEzMjU3MGQwYzI5NTY=
12
12
  data.tar.gz: !binary |-
13
- OWM1MmQwYzBlZTZiNWM5ZDg3YmVlNTQ0ODAzODZiYjIzZmVjYTIzZGM2ODI2
14
- OWQ4ZGFiOGE3NDI5MWI3YTRkNzE0MTVjZjAzZTI4OGJiMDM3MmViMGIzMmQ5
15
- NTVmZDhjZWQxMzVkYmY1MTc3ZTM0NTA1NGE3NDE4OGJiM2JiMjM=
13
+ MTcxZjA2ZDMwNGQzYTU3ODc0NzE0NjFlYTk2YmU4ZDYwMmY5Y2M0ZGU0MmE4
14
+ MzJlZTc5YzJmOWI3OWQ0MjY4OTM3MjBlNGY1YWYxMjA1YTEyMzNjM2VkYzNm
15
+ ZThmMzhhNGRlMzBkYjhlZjQ0MTE1N2VlNzU2MzIxOWVlZTk4YjI=
@@ -1,3 +1,3 @@
1
1
  module RailsScript
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
  end
@@ -3,11 +3,13 @@ window.App ||= {}
3
3
  window.Element ||= {}
4
4
  window.Utility ||= {}
5
5
 
6
- $(document).on "turbolinks:load.rails_script", ->
6
+ # Initializer
7
+ $(document).on "ready.rails_script page:load.rails_script turbolinks:load.rails_script", ->
8
+ controller = $('#rails-script').data('controller')
9
+ action = $('#rails-script').data('action')
7
10
  Utility.RailsVars = $('#rails-script').data('vars')
8
- window.$this = new (App["#{$('#rails-script').data('controller')}"] || App.Base)()
9
11
 
10
- action = $('#rails-script').data('action')
12
+ window.$this = new (App[controller] || App.Base)()
11
13
 
12
14
  if typeof $this.beforeAction == 'function'
13
15
  $this.beforeAction action
@@ -16,8 +18,9 @@ $(document).on "turbolinks:load.rails_script", ->
16
18
  if typeof $this.afterAction == 'function'
17
19
  $this.afterAction action
18
20
 
21
+ # Clear event handlers on navigation
19
22
  RailsScript.setClearEventHandlers = ->
20
- jQuery(document).on 'turbolinks:before-visit', ->
23
+ jQuery(document).on 'page:before-change turbolinks:before-visit', ->
21
24
  for element in [window, document]
22
25
  for event, handlers of (jQuery._data(element, 'events') || {})
23
26
  for handler in handlers
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_script
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Pheasey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-20 00:00:00.000000000 Z
11
+ date: 2016-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler