Intermédiaire
This commit is contained in:
38
Sources/webAduc/www/vendor/vakata/jstree/src/vakata-jstree.js
vendored
Normal file
38
Sources/webAduc/www/vendor/vakata/jstree/src/vakata-jstree.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
(function (factory) {
|
||||
"use strict";
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('jstree.checkbox', ['jquery','./jstree.js'], factory);
|
||||
}
|
||||
else if(typeof exports === 'object') {
|
||||
factory(require('jquery'), require('./jstree.js'));
|
||||
}
|
||||
else {
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($, undefined) {
|
||||
"use strict";
|
||||
if(window.customElements && Object && Object.create) {
|
||||
var proto = Object.create(HTMLElement.prototype);
|
||||
proto.createdCallback = function () {
|
||||
var c = { core : {}, plugins : [] }, i;
|
||||
for(i in $.jstree.plugins) {
|
||||
if($.jstree.plugins.hasOwnProperty(i) && this.attributes[i]) {
|
||||
c.plugins.push(i);
|
||||
if(this.getAttribute(i) && JSON.parse(this.getAttribute(i))) {
|
||||
c[i] = JSON.parse(this.getAttribute(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
for(i in $.jstree.defaults.core) {
|
||||
if($.jstree.defaults.core.hasOwnProperty(i) && this.attributes[i]) {
|
||||
c.core[i] = JSON.parse(this.getAttribute(i)) || this.getAttribute(i);
|
||||
}
|
||||
}
|
||||
$(this).jstree(c);
|
||||
};
|
||||
// proto.attributeChangedCallback = function (name, previous, value) { };
|
||||
try {
|
||||
window.customElements.define("vakata-jstree", function() {}, { prototype: proto });
|
||||
} catch (ignore) { }
|
||||
}
|
||||
}));
|
||||
Reference in New Issue
Block a user