elementaljs-rails 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elementaljs-rails/version.rb +1 -1
- data/vendor/assets/javascripts/elemental.js +13 -4
- 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: 603b6b1a106cf2a4bf05b38395357c0d913e8cb5
|
4
|
+
data.tar.gz: dcd03572efbf63ca06de01a7ce8ddedff3eba513
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bccf244ade751c58c967c97bb2583468b4d4448c048aec96e3f8c505ef7d04df8f67c83afa482aab0157117c0373b61361623785ebb63470b370a19167858db
|
7
|
+
data.tar.gz: 5c4871afcebb29be8328c1f9b53f8c51846e87d6e9e566a3265c249e7ea86614a1d45e391293802d40c81f83b7adebda9304a0abec584efb9e112ab17c4eb148
|
@@ -20,7 +20,11 @@
|
|
20
20
|
});
|
21
21
|
|
22
22
|
if(typeof fn === 'function') {
|
23
|
-
|
23
|
+
if(ns.options.classBased) {
|
24
|
+
return new fn($element);
|
25
|
+
} else {
|
26
|
+
return fn($element);
|
27
|
+
}
|
24
28
|
} else {
|
25
29
|
if (window.console && console.warn) {
|
26
30
|
console.warn("elementalJS: Unable to find behavior:", behavior);
|
@@ -30,20 +34,25 @@
|
|
30
34
|
|
31
35
|
var attachBehaviorsToElement = function(element) {
|
32
36
|
var $element = $(element);
|
33
|
-
var behaviors = $element.data('behavior');
|
37
|
+
var behaviors = $element.data('behavior') || $element.data('behaviour');
|
34
38
|
behaviors.replace(/([^ ]+)/g, function(behavior) {
|
35
39
|
attachBehavior($element, behavior);
|
36
40
|
});
|
37
41
|
};
|
38
42
|
|
43
|
+
ns.options = {
|
44
|
+
classBased: false
|
45
|
+
};
|
46
|
+
|
39
47
|
ns.loadOnly = function(element) {
|
40
48
|
attachBehaviorsToElement(element);
|
41
49
|
};
|
42
50
|
|
43
51
|
ns.load = function(container) {
|
44
|
-
var
|
52
|
+
var selector_name = '[data-behavior], [data-behaviour]';
|
53
|
+
var $behaviors = $(selector_name, container).add($(container).filter(selector_name));
|
45
54
|
|
46
|
-
$
|
55
|
+
$behaviors.each(function(index, element) {
|
47
56
|
attachBehaviorsToElement(element);
|
48
57
|
});
|
49
58
|
};
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elementaljs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robbie Clutton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jquery-rails
|