sudojs-rails 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sudojs/version.rb +1 -1
- data/vendor/assets/javascripts/sudojs/sudo.js +30 -7
- 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: d992bf4b05abd85ca7c01e0a3b2b4dfcd9d61834
|
4
|
+
data.tar.gz: 04a5998a9ed91aa16870b280a4cf978e4d47066f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de7f91acd795c1011aad94f3c9aaf4268f0711383152e5a872db98cff3714f9057e6e7ae691e570b31ecb2b24597fcc7d6cec460e52090ba4418aba3123f79d
|
7
|
+
data.tar.gz: 3e316fa6732f2cd5007cbc85f08634316c6aeebffc7a7cd2a5e7b254b32d20afb3b30329b6bff51ed3890dee211c7cd1c371929225ffb028980634ba420b4503
|
data/lib/sudojs/version.rb
CHANGED
@@ -403,6 +403,22 @@ sudo.Container.prototype.addChildren = function addChildren(arg) {
|
|
403
403
|
//
|
404
404
|
// `returns` {Object|undefined}
|
405
405
|
sudo.Container.prototype.bubble = function bubble() {return this.parent;};
|
406
|
+
// ###eachChild
|
407
|
+
// Call a named method and pass any args to each child in a container's
|
408
|
+
// collection of children
|
409
|
+
//
|
410
|
+
// `param` {*} Any number of arguments the first of which must be
|
411
|
+
// The named method to look for and call. Other args are passed through
|
412
|
+
// `returns` {object} `this`
|
413
|
+
sudo.Container.prototype.eachChild = function eachChild(/*args*/) {
|
414
|
+
var args = Array.prototype.slice.call(arguments),
|
415
|
+
which = args.shift(), i, len, curr;
|
416
|
+
for (i = 0, len = this.children.length; i < len; i++) {
|
417
|
+
curr = this.children[i];
|
418
|
+
if(which in curr) curr[which].apply(curr, args);
|
419
|
+
}
|
420
|
+
return this;
|
421
|
+
};
|
406
422
|
// ###getChild
|
407
423
|
// If a child was added with a name, via `addChild`,
|
408
424
|
// that object can be fetched by name. This prevents us from having to reference a
|
@@ -892,9 +908,13 @@ sudo.inherit(sudo.View, sudo.DataView);
|
|
892
908
|
// ###addedToParent
|
893
909
|
// Container's will check for the presence of this method and call it if it is present
|
894
910
|
// after adding a child - essentially, this will auto render the dataview when added to a parent
|
895
|
-
// as well as setup the events
|
911
|
+
// if not an autoRender (which will render on model change), as well as setup the events (in children too)
|
896
912
|
sudo.DataView.prototype.addedToParent = function(parent) {
|
897
|
-
|
913
|
+
this.bindEvents();
|
914
|
+
this.eachChild('bindEvents');
|
915
|
+
// autoRender Dataviews should only render on model change
|
916
|
+
if(!this.model.data.autoRender) return this.render();
|
917
|
+
return this;
|
898
918
|
};
|
899
919
|
// ###build
|
900
920
|
// Construct the innerHTML of the $el here so that the behavior of the
|
@@ -909,15 +929,18 @@ sudo.DataView.prototype.build = function build() {
|
|
909
929
|
this.built = true;
|
910
930
|
return this;
|
911
931
|
};
|
932
|
+
|
912
933
|
// ###removeFromParent
|
913
934
|
// Remove this object from the DOM and its parent's list of children.
|
914
|
-
// Overrides `sudo.View.removeFromParent` to
|
935
|
+
// Overrides `sudo.View.removeFromParent` to unbind events and remove its $el
|
936
|
+
// as well if passed a truthy value otherwise will $.detach its $el
|
915
937
|
//
|
938
|
+
// `param` {bool} `remove` should this Object $el.remove or $el.detach?
|
916
939
|
// `returns` {Object} `this`
|
917
|
-
sudo.DataView.prototype.removeFromParent = function removeFromParent() {
|
940
|
+
sudo.DataView.prototype.removeFromParent = function removeFromParent(remove) {
|
918
941
|
this.parent.removeChild(this);
|
919
|
-
|
920
|
-
this.unbindEvents
|
942
|
+
this.unbindEvents().$el[remove ? 'remove' : 'detach']();
|
943
|
+
this.eachChild('unbindEvents');
|
921
944
|
return this;
|
922
945
|
};
|
923
946
|
// ###render
|
@@ -1846,7 +1869,7 @@ sudo.delegates.Data.prototype.removeFilter = function removeFilter(key) {
|
|
1846
1869
|
// `private`
|
1847
1870
|
sudo.delegates.Data.prototype.role = 'data';
|
1848
1871
|
|
1849
|
-
sudo.version = "0.9.
|
1872
|
+
sudo.version = "0.9.6";
|
1850
1873
|
window.sudo = sudo;
|
1851
1874
|
if(typeof window._ === "undefined") window._ = sudo;
|
1852
1875
|
}).call(this, this);
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- robrobbins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Install the latest versions of sudo.js and provide generators for fast
|
14
14
|
and easy use.
|