rails_script 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/generators/rails_script/install/templates/base.js.coffee +4 -3
- data/lib/rails_script/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e992abc59f4c61c61138d81747fd2f696d9eeb15
|
4
|
+
data.tar.gz: e4f9ac79d9c520704107e873b2c5a1c42e2a0fc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e20b7739f2d1fb925de399d8ef56b970bd3ddbb0ef462692c26216b53b36815580bd234b775066b46a16ce65ad1859897bb5d448b10bae130de27c81362dc117
|
7
|
+
data.tar.gz: 7b5c16458e222262e61e0f30f89e75fcd517535ba7694dd3dbba31f544e13a420bf23d30afe6d8e152472a79f955d94763b4fa503076947469ca8c4957f5f8e5
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ RailsScript is a Rails-centric, object oriented, featherweight framework for wri
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
gem 'rails_script'
|
9
|
+
gem 'rails_script', '~> 0.3.1'
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
@@ -16,7 +16,7 @@ After bundling you need to run the initial installation generator:
|
|
16
16
|
|
17
17
|
$ rails g rails_script:install
|
18
18
|
|
19
|
-
After the generator finishes, you will be prompted to add helper call to your application layout. The generated code is responsible for initializing and calling the action specific JavaScript. This helper
|
19
|
+
After the generator finishes, you will be prompted to add helper call to your application layout. The generated code is responsible for initializing and calling the action specific JavaScript. This helper should be called before the closing body tag.
|
20
20
|
|
21
21
|
```
|
22
22
|
<%= include_rails_script %>
|
@@ -141,16 +141,16 @@ class Utility.Modal
|
|
141
141
|
|
142
142
|
toggle: (event) =>
|
143
143
|
event.preventDefault()
|
144
|
-
if @
|
144
|
+
if @isOpen then @close() else @open()
|
145
145
|
|
146
146
|
|
147
147
|
open: =>
|
148
|
-
@
|
148
|
+
@isOpen = true
|
149
149
|
@element.show()
|
150
150
|
|
151
151
|
|
152
152
|
close: =>
|
153
|
-
@
|
153
|
+
@isOpen = false
|
154
154
|
@element.fadeOut('fast')
|
155
155
|
```
|
156
156
|
|
@@ -310,8 +310,8 @@ window.App ||= {}
|
|
310
310
|
class App.Users extends App.Base
|
311
311
|
|
312
312
|
index: =>
|
313
|
-
console.log
|
314
|
-
console.log
|
313
|
+
console.log Utility.RailsVars.user
|
314
|
+
console.log Utility.RailsVars.friends
|
315
315
|
```
|
316
316
|
|
317
317
|
|
@@ -30,8 +30,9 @@ class App.Base
|
|
30
30
|
loads, i.e. "$(window).on 'scroll.app', myHandler"
|
31
31
|
###
|
32
32
|
setClearEventHandlers: ->
|
33
|
-
|
33
|
+
$(document).on 'page:before-change', ->
|
34
34
|
for element in [window, document]
|
35
|
-
for event, handlers
|
35
|
+
for event, handlers of ($._data(element, 'events') || {})
|
36
36
|
for handler in handlers
|
37
|
-
if handler.namespace == ''
|
37
|
+
if handler? && handler.namespace == ''
|
38
|
+
$(element).off event, handler.handler
|
data/lib/rails_script/version.rb
CHANGED
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: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Pheasey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|