mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Merge pull request #1945 from Erictoby/develop
사이트 메뉴 편집시 마우스로 메뉴를 이동시킬 때 옮겨지지 않는 확률을 낮춤
This commit is contained in:
commit
60a48004ef
4 changed files with 192 additions and 127 deletions
|
|
@ -13,7 +13,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
|
/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
|
||||||
/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
|
/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false, ActiveXObject: false */
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
@ -114,7 +114,7 @@
|
||||||
if(isMethodCall) {
|
if(isMethodCall) {
|
||||||
if(settings.substring(0, 1) == '_') { return returnValue; }
|
if(settings.substring(0, 1) == '_') { return returnValue; }
|
||||||
this.each(function() {
|
this.each(function() {
|
||||||
var instance = instances[$.data(this, "jstree-instance-id")],
|
var instance = instances[$.data(this, "jstree_instance_id")],
|
||||||
methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
|
methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
|
||||||
if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
|
if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
|
||||||
});
|
});
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
else {
|
else {
|
||||||
this.each(function() {
|
this.each(function() {
|
||||||
// extend settings and allow for multiple hashes and $.data
|
// extend settings and allow for multiple hashes and $.data
|
||||||
var instance_id = $.data(this, "jstree-instance-id"),
|
var instance_id = $.data(this, "jstree_instance_id"),
|
||||||
a = [],
|
a = [],
|
||||||
b = settings ? $.extend({}, true, settings) : {},
|
b = settings ? $.extend({}, true, settings) : {},
|
||||||
c = $(this),
|
c = $(this),
|
||||||
|
|
@ -137,7 +137,7 @@
|
||||||
// push a new empty object to the instances array
|
// push a new empty object to the instances array
|
||||||
instance_id = parseInt(instances.push({}),10) - 1;
|
instance_id = parseInt(instances.push({}),10) - 1;
|
||||||
// store the jstree instance id to the container element
|
// store the jstree instance id to the container element
|
||||||
$.data(this, "jstree-instance-id", instance_id);
|
$.data(this, "jstree_instance_id", instance_id);
|
||||||
// clean up all plugins
|
// clean up all plugins
|
||||||
b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
|
b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
|
||||||
b.plugins.unshift("core");
|
b.plugins.unshift("core");
|
||||||
|
|
@ -159,7 +159,7 @@
|
||||||
$.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
|
$.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
|
||||||
$.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
|
$.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
|
||||||
// initialize the instance
|
// initialize the instance
|
||||||
setTimeout(function() { instances[instance_id].init(); }, 0);
|
setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// return the jquery selection (or if it was a method call that returned a value - the returned value)
|
// return the jquery selection (or if it was a method call that returned a value - the returned value)
|
||||||
|
|
@ -178,7 +178,7 @@
|
||||||
var o = $(needle);
|
var o = $(needle);
|
||||||
if(!o.length && typeof needle === "string") { o = $("#" + needle); }
|
if(!o.length && typeof needle === "string") { o = $("#" + needle); }
|
||||||
if(!o.length) { return null; }
|
if(!o.length) { return null; }
|
||||||
return instances[o.closest(".jstree").data("jstree-instance-id")] || null;
|
return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
|
||||||
},
|
},
|
||||||
_instance : function (index, container, settings) {
|
_instance : function (index, container, settings) {
|
||||||
// for plugins to store data in
|
// for plugins to store data in
|
||||||
|
|
@ -276,7 +276,7 @@
|
||||||
'.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
|
'.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
|
||||||
'.jstree > ul > li { margin-left:0px; } ' +
|
'.jstree > ul > li { margin-left:0px; } ' +
|
||||||
'.jstree-rtl > ul > li { margin-right:0px; } ' +
|
'.jstree-rtl > ul > li { margin-right:0px; } ' +
|
||||||
'.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; vertical-align:top; } ' +
|
'.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
|
||||||
'.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
|
'.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
|
||||||
'.jstree a:focus { outline: none; } ' +
|
'.jstree a:focus { outline: none; } ' +
|
||||||
'.jstree a > ins { height:16px; width:16px; } ' +
|
'.jstree a > ins { height:16px; width:16px; } ' +
|
||||||
|
|
@ -356,7 +356,8 @@
|
||||||
this.get_container()
|
this.get_container()
|
||||||
.delegate("li > ins", "click.jstree", $.proxy(function (event) {
|
.delegate("li > ins", "click.jstree", $.proxy(function (event) {
|
||||||
var trgt = $(event.target);
|
var trgt = $(event.target);
|
||||||
if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
|
// if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
|
||||||
|
this.toggle_node(trgt);
|
||||||
}, this))
|
}, this))
|
||||||
.bind("mousedown.jstree", $.proxy(function () {
|
.bind("mousedown.jstree", $.proxy(function () {
|
||||||
this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
|
this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
|
||||||
|
|
@ -433,7 +434,7 @@
|
||||||
this.get_container()
|
this.get_container()
|
||||||
.unbind(".jstree")
|
.unbind(".jstree")
|
||||||
.undelegate(".jstree")
|
.undelegate(".jstree")
|
||||||
.removeData("jstree-instance-id")
|
.removeData("jstree_instance_id")
|
||||||
.find("[class^='jstree']")
|
.find("[class^='jstree']")
|
||||||
.addBack()
|
.addBack()
|
||||||
.attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
|
.attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
|
||||||
|
|
@ -752,6 +753,7 @@
|
||||||
if(m.language) { tmp.addClass(m.language); }
|
if(m.language) { tmp.addClass(m.language); }
|
||||||
}
|
}
|
||||||
tmp.prepend("<ins class='jstree-icon'> </ins>");
|
tmp.prepend("<ins class='jstree-icon'> </ins>");
|
||||||
|
if(!m.icon && js.icon) { m.icon = js.icon; }
|
||||||
if(m.icon) {
|
if(m.icon) {
|
||||||
if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
|
if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
|
||||||
else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
|
else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
|
||||||
|
|
@ -920,10 +922,12 @@
|
||||||
check_move : function () {
|
check_move : function () {
|
||||||
var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
|
var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
|
||||||
if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
|
if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
|
||||||
if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
|
if(!obj.cy) {
|
||||||
obj.o.each(function () {
|
if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
|
||||||
if(r.parentsUntil(".jstree", "li").addBack().index(this) !== -1) { ret = false; return false; }
|
obj.o.each(function () {
|
||||||
});
|
if(r.parentsUntil(".jstree", "li").addBack().index(this) !== -1) { ret = false; return false; }
|
||||||
|
});
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
|
move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
|
||||||
|
|
@ -1272,16 +1276,15 @@
|
||||||
"class" : "jstree-rename-input",
|
"class" : "jstree-rename-input",
|
||||||
// "size" : t.length,
|
// "size" : t.length,
|
||||||
"css" : {
|
"css" : {
|
||||||
"padding" : "0 4px",
|
"padding" : "0",
|
||||||
"border" : "1px solid silver",
|
"border" : "1px solid silver",
|
||||||
"borderRadius" : "3px",
|
|
||||||
"position" : "absolute",
|
"position" : "absolute",
|
||||||
"left" : (rtl ? "auto" : (w1 + w2) + "px"),
|
"left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
|
||||||
"right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
|
"right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
|
||||||
"top" : "0",
|
"top" : "0px",
|
||||||
"height" : (this.data.core.li_height - 2) + "px",
|
"height" : (this.data.core.li_height - 2) + "px",
|
||||||
"lineHeight" : (this.data.core.li_height - 2) + "px",
|
"lineHeight" : (this.data.core.li_height - 2) + "px",
|
||||||
"width" : "200px" // will be set a bit further down
|
"width" : "150px" // will be set a bit further down
|
||||||
},
|
},
|
||||||
"blur" : $.proxy(function () {
|
"blur" : $.proxy(function () {
|
||||||
var i = obj.children(".jstree-rename-input"),
|
var i = obj.children(".jstree-rename-input"),
|
||||||
|
|
@ -1659,7 +1662,7 @@
|
||||||
obj = this._get_node(obj);
|
obj = this._get_node(obj);
|
||||||
var s = this._get_settings().json_data;
|
var s = this._get_settings().json_data;
|
||||||
if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
|
if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
|
||||||
obj.removeData("jstree-children");
|
obj.removeData("jstree_children");
|
||||||
}
|
}
|
||||||
return this.__call_old();
|
return this.__call_old();
|
||||||
},
|
},
|
||||||
|
|
@ -1669,11 +1672,11 @@
|
||||||
success_func = function () {};
|
success_func = function () {};
|
||||||
obj = this._get_node(obj);
|
obj = this._get_node(obj);
|
||||||
|
|
||||||
if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree-children")) {
|
if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
|
||||||
d = this._parse_json(obj.data("jstree-children"), obj);
|
d = this._parse_json(obj.data("jstree_children"), obj);
|
||||||
if(d) {
|
if(d) {
|
||||||
obj.append(d);
|
obj.append(d);
|
||||||
if(!s.progressive_unload) { obj.removeData("jstree-children"); }
|
if(!s.progressive_unload) { obj.removeData("jstree_children"); }
|
||||||
}
|
}
|
||||||
this.clean_node(obj);
|
this.clean_node(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
|
|
@ -1681,8 +1684,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if(obj && obj !== -1) {
|
if(obj && obj !== -1) {
|
||||||
if(obj.data("jstree-is-loading")) { return; }
|
if(obj.data("jstree_is_loading")) { return; }
|
||||||
else { obj.data("jstree-is-loading",true); }
|
else { obj.data("jstree_is_loading",true); }
|
||||||
}
|
}
|
||||||
switch(!0) {
|
switch(!0) {
|
||||||
case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
|
case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
|
||||||
|
|
@ -1696,14 +1699,14 @@
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(s.correct_state) { this.correct_state(obj); }
|
if(s.correct_state) { this.correct_state(obj); }
|
||||||
}
|
}
|
||||||
if(e_call) { e_call.call(this); }
|
if(e_call) { e_call.call(this); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
||||||
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree-is-loading"); }
|
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
|
||||||
this.clean_node(obj);
|
this.clean_node(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
}
|
}
|
||||||
|
|
@ -1728,7 +1731,7 @@
|
||||||
if(ef) { ef.call(this, x, t, e); }
|
if(ef) { ef.call(this, x, t, e); }
|
||||||
if(obj != -1 && obj.length) {
|
if(obj != -1 && obj.length) {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -1745,7 +1748,7 @@
|
||||||
d = this._parse_json(d, obj);
|
d = this._parse_json(d, obj);
|
||||||
if(d) {
|
if(d) {
|
||||||
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
||||||
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree-is-loading"); }
|
else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
|
||||||
this.clean_node(obj);
|
this.clean_node(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
}
|
}
|
||||||
|
|
@ -1758,7 +1761,7 @@
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(s.correct_state) {
|
if(s.correct_state) {
|
||||||
this.correct_state(obj);
|
this.correct_state(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
|
|
@ -1785,15 +1788,18 @@
|
||||||
|
|
||||||
if(!js) { return d; }
|
if(!js) { return d; }
|
||||||
if(s.progressive_unload && obj && obj !== -1) {
|
if(s.progressive_unload && obj && obj !== -1) {
|
||||||
obj.data("jstree-children", d);
|
obj.data("jstree_children", d);
|
||||||
}
|
}
|
||||||
if($.isArray(js)) {
|
if($.isArray(js)) {
|
||||||
d = $();
|
d = $('<ul>');
|
||||||
if(!js.length) { return false; }
|
if(!js.length) { return false; }
|
||||||
for(i = 0, j = js.length; i < j; i++) {
|
for(i = 0, j = js.length; i < j; i++) {
|
||||||
tmp = this._parse_json(js[i], obj, true);
|
tmp = this._parse_json(js[i], obj, true);
|
||||||
if(tmp.length) { d = d.add(tmp); }
|
if(tmp.length) {
|
||||||
|
d = d.append(tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
d = d.children();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(typeof js == "string") { js = { data : js }; }
|
if(typeof js == "string") { js = { data : js }; }
|
||||||
|
|
@ -1824,10 +1830,10 @@
|
||||||
d.prepend("<ins class='jstree-icon'> </ins>");
|
d.prepend("<ins class='jstree-icon'> </ins>");
|
||||||
if(js.children) {
|
if(js.children) {
|
||||||
if(s.progressive_render && js.state !== "open") {
|
if(s.progressive_render && js.state !== "open") {
|
||||||
d.addClass("jstree-closed").data("jstree-children", js.children);
|
d.addClass("jstree-closed").data("jstree_children", js.children);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(s.progressive_unload) { d.data("jstree-children", js.children); }
|
if(s.progressive_unload) { d.data("jstree_children", js.children); }
|
||||||
if($.isArray(js.children) && js.children.length) {
|
if($.isArray(js.children) && js.children.length) {
|
||||||
tmp = this._parse_json(js.children, obj, true);
|
tmp = this._parse_json(js.children, obj, true);
|
||||||
if(tmp.length) {
|
if(tmp.length) {
|
||||||
|
|
@ -1928,6 +1934,7 @@
|
||||||
* This is useful for maintaining the same structure in many languages (hence the name of the plugin)
|
* This is useful for maintaining the same structure in many languages (hence the name of the plugin)
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
|
var sh = false;
|
||||||
$.jstree.plugin("languages", {
|
$.jstree.plugin("languages", {
|
||||||
__init : function () { this._load_css(); },
|
__init : function () { this._load_css(); },
|
||||||
defaults : [],
|
defaults : [],
|
||||||
|
|
@ -1942,9 +1949,9 @@
|
||||||
else { return false; }
|
else { return false; }
|
||||||
}
|
}
|
||||||
if(i == this.data.languages.current_language) { return true; }
|
if(i == this.data.languages.current_language) { return true; }
|
||||||
st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
|
st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, sh);
|
||||||
if(st !== false) { st.style.display = "none"; }
|
if(st !== false) { st.style.display = "none"; }
|
||||||
st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
|
st = $.vakata.css.get_css(selector + "." + i, false, sh);
|
||||||
if(st !== false) { st.style.display = ""; }
|
if(st !== false) { st.style.display = ""; }
|
||||||
this.data.languages.current_language = i;
|
this.data.languages.current_language = i;
|
||||||
this.__callback(i);
|
this.__callback(i);
|
||||||
|
|
@ -2018,7 +2025,7 @@
|
||||||
if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
|
if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
|
||||||
str += " } ";
|
str += " } ";
|
||||||
}
|
}
|
||||||
this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
|
sh = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
create_node : function (obj, position, js, callback) {
|
create_node : function (obj, position, js, callback) {
|
||||||
|
|
@ -2580,11 +2587,11 @@
|
||||||
switch(r) {
|
switch(r) {
|
||||||
case "before":
|
case "before":
|
||||||
m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
|
m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
|
||||||
if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
|
if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 0) + "px" }).show(); }
|
||||||
break;
|
break;
|
||||||
case "after":
|
case "after":
|
||||||
m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
|
m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
|
||||||
if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
|
if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 0) + "px" }).show(); }
|
||||||
break;
|
break;
|
||||||
case "inside":
|
case "inside":
|
||||||
m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
|
m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
|
||||||
|
|
@ -2691,8 +2698,8 @@
|
||||||
'#vakata-dragged .jstree-ok { background:green; } ' +
|
'#vakata-dragged .jstree-ok { background:green; } ' +
|
||||||
'#vakata-dragged .jstree-invalid { background:red; } ' +
|
'#vakata-dragged .jstree-invalid { background:red; } ' +
|
||||||
'#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
|
'#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
|
||||||
'#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
|
'#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:0px; overflow:hidden; height:0px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; ' +
|
||||||
' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
|
' cursor:not-allowed; border-top:1px dashed #456c43; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
|
||||||
' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
|
' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
|
||||||
'}' +
|
'}' +
|
||||||
'';
|
'';
|
||||||
|
|
@ -2811,19 +2818,20 @@
|
||||||
else {
|
else {
|
||||||
$t.children(":checkbox").addClass("jstree-real-checkbox");
|
$t.children(":checkbox").addClass("jstree-real-checkbox");
|
||||||
}
|
}
|
||||||
if(c === "jstree-checked") {
|
}
|
||||||
$t.children(":checkbox").attr("checked","checked");
|
if(!ts) {
|
||||||
|
if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
|
||||||
|
$t.find("li").addBack().addClass("jstree-checked").children(":checkbox").prop("checked", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(c === "jstree-checked" && !ts) {
|
else {
|
||||||
$t.find("li").addClass("jstree-checked");
|
if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
|
||||||
|
$t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if(!ts) {
|
if(!ts) {
|
||||||
if(obj.length === 1 && obj.is("li")) { this._repair_state(obj); }
|
|
||||||
if(obj.is("li")) { obj.each(function () { _this._repair_state(this); }); }
|
|
||||||
else { obj.find("> ul > li").each(function () { _this._repair_state(this); }); }
|
|
||||||
obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
|
obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -2835,11 +2843,11 @@
|
||||||
if(this._get_settings().checkbox.two_state) {
|
if(this._get_settings().checkbox.two_state) {
|
||||||
if(state) {
|
if(state) {
|
||||||
obj.removeClass("jstree-checked").addClass("jstree-unchecked");
|
obj.removeClass("jstree-checked").addClass("jstree-unchecked");
|
||||||
if(rc) { obj.children(":checkbox").removeAttr("checked"); }
|
if(rc) { obj.children(":checkbox").prop("checked", false); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
obj.removeClass("jstree-unchecked").addClass("jstree-checked");
|
obj.removeClass("jstree-unchecked").addClass("jstree-checked");
|
||||||
if(rc) { obj.children(":checkbox").attr("checked","checked"); }
|
if(rc) { obj.children(":checkbox").prop("checked", true); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -2847,13 +2855,13 @@
|
||||||
coll = obj.find("li").addBack();
|
coll = obj.find("li").addBack();
|
||||||
if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
|
if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
|
||||||
coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
|
coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
|
||||||
if(rc) { coll.children(":checkbox").removeAttr("checked"); }
|
if(rc) { coll.children(":checkbox").prop("checked", false); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
coll = obj.find("li").addBack();
|
coll = obj.find("li").addBack();
|
||||||
if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
|
if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
|
||||||
coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
|
coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
|
||||||
if(rc) { coll.children(":checkbox").attr("checked","checked"); }
|
if(rc) { coll.children(":checkbox").prop("checked", true); }
|
||||||
if(this.data.ui) { this.data.ui.last_selected = obj; }
|
if(this.data.ui) { this.data.ui.last_selected = obj; }
|
||||||
this.data.checkbox.last_selected = obj;
|
this.data.checkbox.last_selected = obj;
|
||||||
}
|
}
|
||||||
|
|
@ -2862,23 +2870,23 @@
|
||||||
if(state) {
|
if(state) {
|
||||||
if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
|
if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
|
||||||
$this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
$this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
||||||
if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
|
if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
|
$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
|
||||||
if(rc) { $this.children(":checkbox").removeAttr("checked"); }
|
if(rc) { $this.children(":checkbox").prop("checked", false); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
|
if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
|
||||||
$this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
$this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
||||||
if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
|
if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
|
$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
|
||||||
if(rc) { $this.children(":checkbox").attr("checked","checked"); }
|
if(rc) { $this.children(":checkbox").prop("checked", true); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -2936,6 +2944,10 @@
|
||||||
_repair_state : function (obj) {
|
_repair_state : function (obj) {
|
||||||
obj = this._get_node(obj);
|
obj = this._get_node(obj);
|
||||||
if(!obj.length) { return; }
|
if(!obj.length) { return; }
|
||||||
|
if(this._get_settings().checkbox.two_state) {
|
||||||
|
obj.find('li').addBack().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var rc = this._get_settings().checkbox.real_checkboxes,
|
var rc = this._get_settings().checkbox.real_checkboxes,
|
||||||
a = obj.find("> ul > .jstree-checked").length,
|
a = obj.find("> ul > .jstree-checked").length,
|
||||||
b = obj.find("> ul > .jstree-undetermined").length,
|
b = obj.find("> ul > .jstree-undetermined").length,
|
||||||
|
|
@ -2945,7 +2957,7 @@
|
||||||
else if(a === c) { this.change_state(obj, false); }
|
else if(a === c) { this.change_state(obj, false); }
|
||||||
else {
|
else {
|
||||||
obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
|
||||||
if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); }
|
if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reselect : function () {
|
reselect : function () {
|
||||||
|
|
@ -2983,49 +2995,37 @@
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
$.vakata.xslt = function (xml, xsl, callback) {
|
$.vakata.xslt = function (xml, xsl, callback) {
|
||||||
var rs = "", xm, xs, processor, support;
|
var r = false, p, q, s;
|
||||||
// TODO: IE9 no XSLTProcessor, no document.recalc
|
// IE9
|
||||||
if(document.recalc) {
|
if(r === false && (window.ActiveXObject || "ActiveXObject" in window)) {
|
||||||
xm = document.createElement('xml');
|
try {
|
||||||
xs = document.createElement('xml');
|
r = new ActiveXObject("Msxml2.XSLTemplate");
|
||||||
xm.innerHTML = xml;
|
q = new ActiveXObject("Msxml2.DOMDocument");
|
||||||
xs.innerHTML = xsl;
|
q.loadXML(xml);
|
||||||
$("body").append(xm).append(xs);
|
s = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
|
||||||
setTimeout( (function (xm, xs, callback) {
|
s.loadXML(xsl);
|
||||||
return function () {
|
r.stylesheet = s;
|
||||||
callback.call(null, xm.transformNode(xs.XMLDocument));
|
p = r.createProcessor();
|
||||||
setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
|
p.input = q;
|
||||||
};
|
p.transform();
|
||||||
})(xm, xs, callback), 100);
|
r = p.output;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
|
|
||||||
xml = new DOMParser().parseFromString(xml, "text/xml");
|
|
||||||
xsl = new DOMParser().parseFromString(xsl, "text/xml");
|
|
||||||
// alert(xml.transformNode());
|
|
||||||
// callback.call(null, new XMLSerializer().serializeToString(rs));
|
|
||||||
|
|
||||||
}
|
|
||||||
if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
|
|
||||||
processor = new XSLTProcessor();
|
|
||||||
support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
|
|
||||||
if(!support) { return false; }
|
|
||||||
xml = new DOMParser().parseFromString(xml, "text/xml");
|
|
||||||
xsl = new DOMParser().parseFromString(xsl, "text/xml");
|
|
||||||
if($.isFunction(processor.transformDocument)) {
|
|
||||||
rs = document.implementation.createDocument("", "", null);
|
|
||||||
processor.transformDocument(xml, xsl, rs, null);
|
|
||||||
callback.call(null, new XMLSerializer().serializeToString(rs));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
processor.importStylesheet(xsl);
|
|
||||||
rs = processor.transformToFragment(xml, document);
|
|
||||||
callback.call(null, $("<div />").append(rs).html());
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
catch (e) { }
|
||||||
}
|
}
|
||||||
return false;
|
xml = $.parseXML(xml);
|
||||||
|
xsl = $.parseXML(xsl);
|
||||||
|
// FF, Chrome
|
||||||
|
if(r === false && typeof (XSLTProcessor) !== "undefined") {
|
||||||
|
p = new XSLTProcessor();
|
||||||
|
p.importStylesheet(xsl);
|
||||||
|
r = p.transformToFragment(xml, document);
|
||||||
|
r = $('<div />').append(r).html();
|
||||||
|
}
|
||||||
|
// OLD IE
|
||||||
|
if(r === false && typeof (xml.transformNode) !== "undefined") {
|
||||||
|
r = xml.transformNode(xsl);
|
||||||
|
}
|
||||||
|
callback.call(null, r);
|
||||||
};
|
};
|
||||||
var xsl = {
|
var xsl = {
|
||||||
'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
|
'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
|
||||||
|
|
@ -3194,8 +3194,8 @@
|
||||||
|
|
||||||
obj = this._get_node(obj);
|
obj = this._get_node(obj);
|
||||||
if(obj && obj !== -1) {
|
if(obj && obj !== -1) {
|
||||||
if(obj.data("jstree-is-loading")) { return; }
|
if(obj.data("jstree_is_loading")) { return; }
|
||||||
else { obj.data("jstree-is-loading",true); }
|
else { obj.data("jstree_is_loading",true); }
|
||||||
}
|
}
|
||||||
switch(!0) {
|
switch(!0) {
|
||||||
case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
|
case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
|
||||||
|
|
@ -3207,14 +3207,14 @@
|
||||||
if(d.length > 10) {
|
if(d.length > 10) {
|
||||||
d = $(d);
|
d = $(d);
|
||||||
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
||||||
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree-is-loading"); }
|
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
|
||||||
if(s.clean_node) { this.clean_node(obj); }
|
if(s.clean_node) { this.clean_node(obj); }
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(obj && obj !== -1) {
|
if(obj && obj !== -1) {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(s.correct_state) {
|
if(s.correct_state) {
|
||||||
this.correct_state(obj);
|
this.correct_state(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
|
|
@ -3258,7 +3258,7 @@
|
||||||
if(ef) { ef.call(this, x, t, e); }
|
if(ef) { ef.call(this, x, t, e); }
|
||||||
if(obj !== -1 && obj.length) {
|
if(obj !== -1 && obj.length) {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -3279,14 +3279,14 @@
|
||||||
if(d.length > 10) {
|
if(d.length > 10) {
|
||||||
d = $(d);
|
d = $(d);
|
||||||
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
|
||||||
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree-is-loading"); }
|
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
|
||||||
if(s.clean_node) { this.clean_node(obj); }
|
if(s.clean_node) { this.clean_node(obj); }
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(obj && obj !== -1) {
|
if(obj && obj !== -1) {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(s.correct_state) {
|
if(s.correct_state) {
|
||||||
this.correct_state(obj);
|
this.correct_state(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
|
|
@ -3401,12 +3401,26 @@
|
||||||
* DOES NOT WORK WITH JSON PROGRESSIVE RENDER
|
* DOES NOT WORK WITH JSON PROGRESSIVE RENDER
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
$.expr[':'].jstree_contains = function(a,i,m){
|
if($().jquery.split('.')[1] >= 8) {
|
||||||
return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
|
$.expr[':'].jstree_contains = $.expr.createPseudo(function(search) {
|
||||||
};
|
return function(a) {
|
||||||
$.expr[':'].jstree_title_contains = function(a,i,m) {
|
return (a.textContent || a.innerText || "").toLowerCase().indexOf(search.toLowerCase())>=0;
|
||||||
return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
|
};
|
||||||
};
|
});
|
||||||
|
$.expr[':'].jstree_title_contains = $.expr.createPseudo(function(search) {
|
||||||
|
return function(a) {
|
||||||
|
return (a.getAttribute("title") || "").toLowerCase().indexOf(search.toLowerCase())>=0;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$.expr[':'].jstree_contains = function(a,i,m){
|
||||||
|
return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
|
||||||
|
};
|
||||||
|
$.expr[':'].jstree_title_contains = function(a,i,m) {
|
||||||
|
return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
|
||||||
|
};
|
||||||
|
}
|
||||||
$.jstree.plugin("search", {
|
$.jstree.plugin("search", {
|
||||||
__init : function () {
|
__init : function () {
|
||||||
this.data.search.str = "";
|
this.data.search.str = "";
|
||||||
|
|
@ -4021,8 +4035,8 @@
|
||||||
success_func = function () {};
|
success_func = function () {};
|
||||||
obj = this._get_node(obj);
|
obj = this._get_node(obj);
|
||||||
if(obj && obj !== -1) {
|
if(obj && obj !== -1) {
|
||||||
if(obj.data("jstree-is-loading")) { return; }
|
if(obj.data("jstree_is_loading")) { return; }
|
||||||
else { obj.data("jstree-is-loading",true); }
|
else { obj.data("jstree_is_loading",true); }
|
||||||
}
|
}
|
||||||
switch(!0) {
|
switch(!0) {
|
||||||
case ($.isFunction(s.data)):
|
case ($.isFunction(s.data)):
|
||||||
|
|
@ -4031,14 +4045,14 @@
|
||||||
d = $(d);
|
d = $(d);
|
||||||
if(!d.is("ul")) { d = $("<ul />").append(d); }
|
if(!d.is("ul")) { d = $("<ul />").append(d); }
|
||||||
if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
|
if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
|
||||||
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree-is-loading"); }
|
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
|
||||||
this.clean_node(obj);
|
this.clean_node(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(obj && obj !== -1) {
|
if(obj && obj !== -1) {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(s.correct_state) {
|
if(s.correct_state) {
|
||||||
this.correct_state(obj);
|
this.correct_state(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
|
|
@ -4083,7 +4097,7 @@
|
||||||
if(ef) { ef.call(this, x, t, e); }
|
if(ef) { ef.call(this, x, t, e); }
|
||||||
if(obj != -1 && obj.length) {
|
if(obj != -1 && obj.length) {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
if(t === "success" && s.correct_state) { this.correct_state(obj); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -4101,14 +4115,14 @@
|
||||||
d = $(d);
|
d = $(d);
|
||||||
if(!d.is("ul")) { d = $("<ul />").append(d); }
|
if(!d.is("ul")) { d = $("<ul />").append(d); }
|
||||||
if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
|
if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
|
||||||
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree-is-loading"); }
|
else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
|
||||||
this.clean_node(obj);
|
this.clean_node(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(obj && obj !== -1) {
|
if(obj && obj !== -1) {
|
||||||
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
obj.children("a.jstree-loading").removeClass("jstree-loading");
|
||||||
obj.removeData("jstree-is-loading");
|
obj.removeData("jstree_is_loading");
|
||||||
if(s.correct_state) {
|
if(s.correct_state) {
|
||||||
this.correct_state(obj);
|
this.correct_state(obj);
|
||||||
if(s_call) { s_call.call(this); }
|
if(s_call) { s_call.call(this); }
|
||||||
|
|
@ -4219,7 +4233,8 @@
|
||||||
_fn : {
|
_fn : {
|
||||||
_themeroller : function (obj) {
|
_themeroller : function (obj) {
|
||||||
var s = this._get_settings().themeroller;
|
var s = this._get_settings().themeroller;
|
||||||
obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
|
obj = (!obj || obj == -1) ? this.get_container_ul() : this._get_node(obj);
|
||||||
|
obj = (!obj || obj == -1) ? this.get_container_ul() : obj.parent();
|
||||||
obj
|
obj
|
||||||
.find("li.jstree-closed")
|
.find("li.jstree-closed")
|
||||||
.children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
|
.children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
|
||||||
|
|
@ -4332,15 +4347,19 @@
|
||||||
},
|
},
|
||||||
_fn : {
|
_fn : {
|
||||||
_check_unique : function (nms, p, func) {
|
_check_unique : function (nms, p, func) {
|
||||||
var cnms = [];
|
var cnms = [], ok = true;
|
||||||
p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
|
p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
|
||||||
if(!cnms.length || !nms.length) { return true; }
|
if(!cnms.length || !nms.length) { return true; }
|
||||||
cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
|
$.each(nms, function (i, v) {
|
||||||
if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
|
if($.inArray(v, cnms) !== -1) {
|
||||||
|
ok = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(!ok) {
|
||||||
this._get_settings().unique.error_callback.call(null, nms, p, func);
|
this._get_settings().unique.error_callback.call(null, nms, p, func);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return ok;
|
||||||
},
|
},
|
||||||
check_move : function () {
|
check_move : function () {
|
||||||
if(!this.__call_old()) { return false; }
|
if(!this.__call_old()) { return false; }
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,29 @@
|
||||||
#vakata-dragged.jstree-default .jstree-ok{background:url("d.png") -2px -53px no-repeat !important}
|
#vakata-dragged.jstree-default .jstree-ok{background:url("d.png") -2px -53px no-repeat !important}
|
||||||
#vakata-dragged.jstree-default .jstree-invalid{background:url("d.png") -18px -53px no-repeat !important}
|
#vakata-dragged.jstree-default .jstree-invalid{background:url("d.png") -18px -53px no-repeat !important}
|
||||||
#jstree-marker.jstree-default{background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px}
|
#jstree-marker.jstree-default{background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px}
|
||||||
|
#jstree-marker-line.jstree-default {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
line-height: 0%;
|
||||||
|
font-size: 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 0px;
|
||||||
|
width: 100px;
|
||||||
|
position: absolute;
|
||||||
|
top: -30px;
|
||||||
|
z-index: 10000;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
display: none;
|
||||||
|
cursor: not-allowed;
|
||||||
|
border-top: 1px dashed #456c43;
|
||||||
|
border-left: 0;
|
||||||
|
-moz-box-shadow: 0px 0px 2px #666;
|
||||||
|
-webkit-box-shadow: 0px 0px 2px #666;
|
||||||
|
box-shadow: 0px 0px 2px #666;
|
||||||
|
-moz-border-radius: 1px;
|
||||||
|
border-radius: 1px;
|
||||||
|
-webkit-border-radius: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
.jstree-default a.jstree-search{color:aqua}
|
.jstree-default a.jstree-search{color:aqua}
|
||||||
.jstree-default .jstree-locked a{color:silver; cursor:default}
|
.jstree-default .jstree-locked a{color:silver; cursor:default}
|
||||||
|
|
@ -78,4 +101,4 @@
|
||||||
.jstree-default .jstree-undetermined a .jstree-checkbox{_background-position:-20px -19px}
|
.jstree-default .jstree-undetermined a .jstree-checkbox{_background-position:-20px -19px}
|
||||||
.jstree-default .jstree-checked a .jstree-checkbox{_background-position:-38px -19px}
|
.jstree-default .jstree-checked a .jstree-checkbox{_background-position:-38px -19px}
|
||||||
.jstree-default .jstree-unchecked a .jstree-checkbox{_background-position:-2px -19px}
|
.jstree-default .jstree-unchecked a .jstree-checkbox{_background-position:-2px -19px}
|
||||||
/* IE6 END */
|
/* IE6 END */
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ padding:0;list-style:none}
|
||||||
.mapi>ul>li>ul{margin:0 0 0 18px}
|
.mapi>ul>li>ul{margin:0 0 0 18px}
|
||||||
.mapi>ul>li>ul>li{margin-left:0}
|
.mapi>ul>li>ul>li{margin-left:0}
|
||||||
/* li>a */
|
/* li>a */
|
||||||
.mapi li>a{border:0;padding:0 8px;margin:0 0 1px 0;border-radius:3px;position:relative;z-index:2;height:23px;line-height:23px;max-width:160px;overflow:hidden;text-overflow:ellipsis;}
|
.mapi li>a{border:0;padding:0 8px;margin:0 0 0 0;border-radius:3px;position:relative;z-index:2;height:28px;line-height:28px;max-width:160px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;}
|
||||||
.mapi li>a>i{opacity:.5;filter:alpha(opacity=50)}
|
.mapi li>a>i{opacity:.5;filter:alpha(opacity=50)}
|
||||||
/* Plugin style override */
|
/* Plugin style override */
|
||||||
.mapi a>.jstree-icon{display:none}
|
.mapi a>.jstree-icon{display:none}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,29 @@
|
||||||
#vakata-dragged.jstree-default .jstree-ok{background:url("d.png") -2px -53px no-repeat !important}
|
#vakata-dragged.jstree-default .jstree-ok{background:url("d.png") -2px -53px no-repeat !important}
|
||||||
#vakata-dragged.jstree-default .jstree-invalid{background:url("d.png") -18px -53px no-repeat !important}
|
#vakata-dragged.jstree-default .jstree-invalid{background:url("d.png") -18px -53px no-repeat !important}
|
||||||
#jstree-marker.jstree-default{background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px}
|
#jstree-marker.jstree-default{background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px}
|
||||||
|
#jstree-marker-line.jstree-default {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
line-height: 0%;
|
||||||
|
font-size: 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 0px;
|
||||||
|
width: 100px;
|
||||||
|
position: absolute;
|
||||||
|
top: -30px;
|
||||||
|
z-index: 10000;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
display: none;
|
||||||
|
cursor: not-allowed;
|
||||||
|
border-top: 1px dashed #456c43;
|
||||||
|
border-left: 0;
|
||||||
|
-moz-box-shadow: 0px 0px 2px #666;
|
||||||
|
-webkit-box-shadow: 0px 0px 2px #666;
|
||||||
|
box-shadow: 0px 0px 2px #666;
|
||||||
|
-moz-border-radius: 1px;
|
||||||
|
border-radius: 1px;
|
||||||
|
-webkit-border-radius: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
.jstree-default a.jstree-search{color:aqua}
|
.jstree-default a.jstree-search{color:aqua}
|
||||||
.jstree-default .jstree-locked a{color:silver; cursor:default}
|
.jstree-default .jstree-locked a{color:silver; cursor:default}
|
||||||
|
|
@ -78,4 +101,4 @@
|
||||||
.jstree-default .jstree-undetermined a .jstree-checkbox{_background-position:-20px -19px}
|
.jstree-default .jstree-undetermined a .jstree-checkbox{_background-position:-20px -19px}
|
||||||
.jstree-default .jstree-checked a .jstree-checkbox{_background-position:-38px -19px}
|
.jstree-default .jstree-checked a .jstree-checkbox{_background-position:-38px -19px}
|
||||||
.jstree-default .jstree-unchecked a .jstree-checkbox{_background-position:-2px -19px}
|
.jstree-default .jstree-unchecked a .jstree-checkbox{_background-position:-2px -19px}
|
||||||
/* IE6 END */
|
/* IE6 END */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue