Skip to content

Commit

Permalink
fixes to types plugin - close #530
Browse files Browse the repository at this point in the history
  • Loading branch information
vakata committed Feb 11, 2014
1 parent 32dab75 commit f681106
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/jstree.js
Original file line number Diff line number Diff line change
Expand Up @@ -5337,7 +5337,7 @@
var k = $.vakata.storage.get(this.settings.state.key);
if(!!k) { try { k = $.vakata.json.decode(k); } catch(ex) { return false; } }
if(!!k && k.ttl && k.sec && +(new Date()) - k.sec > k.ttl) { return false; }
else { k = k.state; }
if(!!k && k.state) { k = k.state; }
if(!!k && $.isFunction(this.settings.state.filter)) { k = this.settings.state.filter.call(this, k); }
if(!!k) {
this.element.one("set_state.jstree", function (e, data) { data.instance.trigger('restore_state', { 'state' : $.extend(true, {}, k) }); });
Expand Down
4 changes: 2 additions & 2 deletions dist/jstree.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/dist/jstree.js
Original file line number Diff line number Diff line change
Expand Up @@ -5337,7 +5337,7 @@
var k = $.vakata.storage.get(this.settings.state.key);
if(!!k) { try { k = $.vakata.json.decode(k); } catch(ex) { return false; } }
if(!!k && k.ttl && k.sec && +(new Date()) - k.sec > k.ttl) { return false; }
else { k = k.state; }
if(!!k && k.state) { k = k.state; }
if(!!k && $.isFunction(this.settings.state.filter)) { k = this.settings.state.filter.call(this, k); }
if(!!k) {
this.element.one("set_state.jstree", function (e, data) { data.instance.trigger('restore_state', { 'state' : $.extend(true, {}, k) }); });
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/dist/jstree.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/jstree.json
Original file line number Diff line number Diff line change
Expand Up @@ -6336,7 +6336,7 @@
},
"isPrivate": false,
"ignore": false,
"code": "this.restore_state = function () {\n\t\t\tvar k = $.vakata.storage.get(this.settings.state.key);\n\t\t\tif(!!k) { try { k = $.vakata.json.decode(k); } catch(ex) { return false; } }\n\t\t\tif(!!k && k.ttl && k.sec && +(new Date()) - k.sec > k.ttl) { return false; }\n\t\t\telse { k = k.state; }\n\t\t\tif(!!k && $.isFunction(this.settings.state.filter)) { k = this.settings.state.filter.call(this, k); }\n\t\t\tif(!!k) {\n\t\t\t\tthis.element.one(\"set_state.jstree\", function (e, data) { data.instance.trigger('restore_state', { 'state' : $.extend(true, {}, k) }); });\n\t\t\t\tthis.set_state(k);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t};",
"code": "this.restore_state = function () {\n\t\t\tvar k = $.vakata.storage.get(this.settings.state.key);\n\t\t\tif(!!k) { try { k = $.vakata.json.decode(k); } catch(ex) { return false; } }\n\t\t\tif(!!k && k.ttl && k.sec && +(new Date()) - k.sec > k.ttl) { return false; }\n\t\t\tif(!!k && k.state) { k = k.state; }\n\t\t\tif(!!k && $.isFunction(this.settings.state.filter)) { k = this.settings.state.filter.call(this, k); }\n\t\t\tif(!!k) {\n\t\t\t\tthis.element.one(\"set_state.jstree\", function (e, data) { data.instance.trigger('restore_state', { 'state' : $.extend(true, {}, k) }); });\n\t\t\t\tthis.set_state(k);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t};",
"ctx": {
"type": "method",
"receiver": "this",
Expand Down
2 changes: 1 addition & 1 deletion src/jstree.state.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
var k = $.vakata.storage.get(this.settings.state.key);
if(!!k) { try { k = $.vakata.json.decode(k); } catch(ex) { return false; } }
if(!!k && k.ttl && k.sec && +(new Date()) - k.sec > k.ttl) { return false; }
else { k = k.state; }
if(!!k && k.state) { k = k.state; }
if(!!k && $.isFunction(this.settings.state.filter)) { k = this.settings.state.filter.call(this, k); }
if(!!k) {
this.element.one("set_state.jstree", function (e, data) { data.instance.trigger('restore_state', { 'state' : $.extend(true, {}, k) }); });
Expand Down

0 comments on commit f681106

Please sign in to comment.