tao_on_rails 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/tao/application.coffee +4 -1
- data/lib/assets/javascripts/tao/component.coffee +4 -2
- data/lib/assets/javascripts/tao/page.coffee +0 -3
- data/lib/tao_on_rails/action_view/helpers.rb +11 -6
- data/lib/tao_on_rails/components/base.rb +1 -1
- data/lib/tao_on_rails/components.rb +0 -5
- data/lib/tao_on_rails/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5cd10cf94e1abe75c759862792a084a403dd9fe
|
4
|
+
data.tar.gz: 2987b6c9ec002b7fad6a568c0a47029a079e78be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7e6023f2c0336c9adadfb79349ffe1ff6b2275a163a08a5c7820d9792cb64ad1577aa7b5fbaa44c29fe6a1a4b01c2cf91dc6cc19ab89b8958d4c835839d9101
|
7
|
+
data.tar.gz: cdc4059cf58af554318ccd4a0b101ff731c9b1bc96402fa1abded551f90b8721d1bc61ef7dec665e72e1520fb215a7f5fc32b54eb8abd3395cd558a4ad89de87
|
@@ -39,7 +39,7 @@ class TaoApplication extends TaoModule
|
|
39
39
|
|
40
40
|
_initTurbolinks: ->
|
41
41
|
$(document).on 'turbolinks:before-visit', (e) =>
|
42
|
-
if @currentPage?.trigger('before-leave') == false
|
42
|
+
if @currentPage?.trigger?('before-leave') == false
|
43
43
|
e.preventDefault()
|
44
44
|
return
|
45
45
|
|
@@ -53,6 +53,9 @@ class TaoApplication extends TaoModule
|
|
53
53
|
|
54
54
|
.on 'turbolinks:before-cache', (e) =>
|
55
55
|
@trigger 'before-page-cache', [@currentPage]
|
56
|
+
$(@currentPage).find('[tao-id]').each (i, el) ->
|
57
|
+
el.beforeCache?()
|
58
|
+
null
|
56
59
|
@currentPage?.beforeCache?()
|
57
60
|
window.currentPage = @currentPage = null
|
58
61
|
|
@@ -153,11 +153,13 @@ TaoComponentBasedOn = (superClassName = 'HTMLElement') ->
|
|
153
153
|
component
|
154
154
|
|
155
155
|
on: (name, args...) ->
|
156
|
-
|
156
|
+
if name && name.indexOf('.') < 0
|
157
|
+
name = "#{name}.#{@constructor._tag}-#{@taoId}"
|
157
158
|
@jq.on name, args...
|
158
159
|
|
159
160
|
off: (name = '', args...) ->
|
160
|
-
|
161
|
+
if name.indexOf('.') < 0
|
162
|
+
name = "#{name}.#{@constructor._tag}-#{@taoId}"
|
161
163
|
@jq.off name, args...
|
162
164
|
|
163
165
|
trigger: (args...) ->
|
@@ -11,12 +11,8 @@ module TaoOnRails
|
|
11
11
|
# Define the dynamic view helpers for components
|
12
12
|
# This method should be called in action_view context
|
13
13
|
def self.define_component_helpers
|
14
|
-
|
15
|
-
|
16
|
-
Rails.root.join('app/components/**/*.rb')
|
17
|
-
]).each do |component|
|
18
|
-
require component
|
19
|
-
end
|
14
|
+
load_tao_components
|
15
|
+
::ActiveSupport.run_load_hooks(:tao_components, self)
|
20
16
|
|
21
17
|
TaoOnRails::Components::Base.descendants.each do |klass|
|
22
18
|
module_eval %Q{
|
@@ -27,6 +23,15 @@ module TaoOnRails
|
|
27
23
|
end
|
28
24
|
end
|
29
25
|
|
26
|
+
def self.load_tao_components(root = Rails.root)
|
27
|
+
Dir.glob([
|
28
|
+
root.join('lib/components/**/*.rb'),
|
29
|
+
root.join('app/components/**/*.rb')
|
30
|
+
]).each do |component|
|
31
|
+
require_dependency component
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
30
35
|
end
|
31
36
|
end
|
32
37
|
end
|
data/lib/tao_on_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tao_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siyuan Liu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: turbolinks
|
@@ -107,14 +107,14 @@ dependencies:
|
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.7.
|
110
|
+
version: 0.7.1
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
113
|
version_requirements: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.7.
|
117
|
+
version: 0.7.1
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: mocha
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|