in optaplanner-docs/src/modules/ROOT/images/website/jstree/jstree.js [8022:8078]
this.bind = function () {
this.element
.on('model.jstree', $.proxy(function (e, data) {
var m = this._model.data,
dpc = data.nodes,
t = this.settings.types,
i, j, c = 'default', k;
for(i = 0, j = dpc.length; i < j; i++) {
c = 'default';
if(m[dpc[i]].original && m[dpc[i]].original.type && t[m[dpc[i]].original.type]) {
c = m[dpc[i]].original.type;
}
if(m[dpc[i]].data && m[dpc[i]].data.jstree && m[dpc[i]].data.jstree.type && t[m[dpc[i]].data.jstree.type]) {
c = m[dpc[i]].data.jstree.type;
}
m[dpc[i]].type = c;
if(m[dpc[i]].icon === true && t[c].icon !== undefined) {
m[dpc[i]].icon = t[c].icon;
}
if(t[c].li_attr !== undefined && typeof t[c].li_attr === 'object') {
for (k in t[c].li_attr) {
if (t[c].li_attr.hasOwnProperty(k)) {
if (k === 'id') {
continue;
}
else if (m[dpc[i]].li_attr[k] === undefined) {
m[dpc[i]].li_attr[k] = t[c].li_attr[k];
}
else if (k === 'class') {
m[dpc[i]].li_attr['class'] = t[c].li_attr['class'] + ' ' + m[dpc[i]].li_attr['class'];
}
}
}
}
if(t[c].a_attr !== undefined && typeof t[c].a_attr === 'object') {
for (k in t[c].a_attr) {
if (t[c].a_attr.hasOwnProperty(k)) {
if (k === 'id') {
continue;
}
else if (m[dpc[i]].a_attr[k] === undefined) {
m[dpc[i]].a_attr[k] = t[c].a_attr[k];
}
else if (k === 'href' && m[dpc[i]].a_attr[k] === '#') {
m[dpc[i]].a_attr['href'] = t[c].a_attr['href'];
}
else if (k === 'class') {
m[dpc[i]].a_attr['class'] = t[c].a_attr['class'] + ' ' + m[dpc[i]].a_attr['class'];
}
}
}
}
}
m[$.jstree.root].type = $.jstree.root;
}, this));
parent.bind.call(this);
};