sudojs-rails 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -13
- data/lib/sudojs/version.rb +1 -1
- data/vendor/assets/javascripts/sudojs/sudo-x.js +2 -2
- 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: 1b20dbdb854d617e86664287569193276efb8eb3
|
4
|
+
data.tar.gz: bbd5635d6ec760e77bd282873b391eae209c1999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fc9ebfdaec8ca14a8a3c71b140cf8e3b799f130eadf53b907a6ce8015fa5dbf55bf19fb954db424c30ded14d434ede30b16fbc4ba8aff6ded60b585117509c7
|
7
|
+
data.tar.gz: 250e7ce70971d386320e7ea248e76cb03dcfc615caf32d8a3a6d4b9f68594087753d51af2cca969755f25517ede251d0e32fe3936a0595237dca6e0ba984d065
|
data/README.md
CHANGED
@@ -40,32 +40,32 @@ Before use, a few steps need to be followed to prepare your project for our pref
|
|
40
40
|
+ We place manifest files into an `app/assets/javascripts/manifests` directory. This means that your
|
41
41
|
`app/views/layouts/application.html.*` file needs to be adjusted to account for this:
|
42
42
|
|
43
|
-
|
43
|
+
<%= javascript_include_tag 'manifests/application.js' %>
|
44
|
+
|
44
45
|
|
45
46
|
Preferably, you will **not** place this in your `head` tag
|
46
47
|
|
47
48
|
+ We assume that any Class Object not used more than once (i.e. is unique to a particular controller#action)
|
48
49
|
will not go into `application.js` but be placed into its own manifest for that controller. For this to function,
|
49
|
-
a helper method can be constructed
|
50
|
+
a helper method can be constructed in app/helpers/application_helper.rb
|
51
|
+
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
53
|
+
def controller_javascript
|
54
|
+
controller_manifest = File.join('manifests', "#{self.controller_name}.js")
|
55
|
+
return '' if Rails.application.assets.find_asset(controller_manifest).nil?
|
56
|
+
return javascript_include_tag(controller_manifest)
|
57
|
+
end
|
55
58
|
|
56
|
-
return javascript_include_tag(controller_manifest)
|
57
|
-
end
|
58
59
|
|
59
60
|
This allows the following, combined with the previous include tag:
|
60
61
|
|
61
|
-
|
62
|
-
|
62
|
+
<%= javascript_include_tag 'manifests/application.js' %>
|
63
|
+
<%= controller_javascript %>
|
63
64
|
|
64
65
|
+ When concatonating for `staging` and `production` environments the following code needs to have been inserted
|
65
66
|
into your `config/environments/staging` and `config/environments/production` .rb files:
|
66
|
-
|
67
|
-
|
68
|
-
config.assets.precompile += %w( manifests/* )
|
67
|
+
|
68
|
+
config.assets.precompile += %w( manifests/* )
|
69
69
|
|
70
70
|
### In Practice
|
71
71
|
|
data/lib/sudojs/version.rb
CHANGED
@@ -846,8 +846,8 @@ sudo.DataView = function(el, data) {
|
|
846
846
|
sudo.View.call(this, el, d);
|
847
847
|
// implements the listener extension
|
848
848
|
$.extend(this, sudo.extensions.listener);
|
849
|
-
// dataview's models are observable
|
850
|
-
$.extend(this.model, sudo.extensions.observable);
|
849
|
+
// dataview's models are observable, make it so if not already
|
850
|
+
if(!this.model.observe) $.extend(this.model, sudo.extensions.observable);
|
851
851
|
// dont autoRender on the setting of events,
|
852
852
|
// add to this to prevent others if needed
|
853
853
|
this.autoRenderBlacklist = {event: true, events: true};
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sudojs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- robrobbins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|