Mercurial > repos > mingchen0919 > aurora_deseq2_site
annotate vakata-jstree-3.3.5/src/jstree.wholerow.js @ 2:ab8d558ea6e6 draft default tip
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
author | mingchen0919 |
---|---|
date | Sun, 30 Dec 2018 13:57:07 -0500 |
parents | 32210899a3dd |
children |
rev | line source |
---|---|
1
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
1 /** |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
2 * ### Wholerow plugin |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
3 * |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
4 * Makes each node appear block level. Making selection easier. May cause slow down for large trees in old browsers. |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
5 */ |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
6 /*globals jQuery, define, exports, require */ |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
7 (function (factory) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
8 "use strict"; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
9 if (typeof define === 'function' && define.amd) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
10 define('jstree.wholerow', ['jquery','jstree'], factory); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
11 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
12 else if(typeof exports === 'object') { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
13 factory(require('jquery'), require('jstree')); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
14 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
15 else { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
16 factory(jQuery, jQuery.jstree); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
17 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
18 }(function ($, jstree, undefined) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
19 "use strict"; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
20 |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
21 if($.jstree.plugins.wholerow) { return; } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
22 |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
23 var div = document.createElement('DIV'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
24 div.setAttribute('unselectable','on'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
25 div.setAttribute('role','presentation'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
26 div.className = 'jstree-wholerow'; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
27 div.innerHTML = ' '; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
28 $.jstree.plugins.wholerow = function (options, parent) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
29 this.bind = function () { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
30 parent.bind.call(this); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
31 |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
32 this.element |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
33 .on('ready.jstree set_state.jstree', $.proxy(function () { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
34 this.hide_dots(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
35 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
36 .on("init.jstree loading.jstree ready.jstree", $.proxy(function () { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
37 //div.style.height = this._data.core.li_height + 'px'; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
38 this.get_container_ul().addClass('jstree-wholerow-ul'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
39 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
40 .on("deselect_all.jstree", $.proxy(function (e, data) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
41 this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
42 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
43 .on("changed.jstree", $.proxy(function (e, data) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
44 this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
45 var tmp = false, i, j; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
46 for(i = 0, j = data.selected.length; i < j; i++) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
47 tmp = this.get_node(data.selected[i], true); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
48 if(tmp && tmp.length) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
49 tmp.children('.jstree-wholerow').addClass('jstree-wholerow-clicked'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
50 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
51 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
52 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
53 .on("open_node.jstree", $.proxy(function (e, data) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
54 this.get_node(data.node, true).find('.jstree-clicked').parent().children('.jstree-wholerow').addClass('jstree-wholerow-clicked'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
55 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
56 .on("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
57 if(e.type === "hover_node" && this.is_disabled(data.node)) { return; } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
58 this.get_node(data.node, true).children('.jstree-wholerow')[e.type === "hover_node"?"addClass":"removeClass"]('jstree-wholerow-hovered'); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
59 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
60 .on("contextmenu.jstree", ".jstree-wholerow", $.proxy(function (e) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
61 if (this._data.contextmenu) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
62 e.preventDefault(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
63 var tmp = $.Event('contextmenu', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey, pageX : e.pageX, pageY : e.pageY }); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
64 $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
65 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
66 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
67 /*! |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
68 .on("mousedown.jstree touchstart.jstree", ".jstree-wholerow", function (e) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
69 if(e.target === e.currentTarget) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
70 var a = $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor"); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
71 e.target = a[0]; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
72 a.trigger(e); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
73 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
74 }) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
75 */ |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
76 .on("click.jstree", ".jstree-wholerow", function (e) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
77 e.stopImmediatePropagation(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
78 var tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey }); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
79 $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
80 }) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
81 .on("dblclick.jstree", ".jstree-wholerow", function (e) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
82 e.stopImmediatePropagation(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
83 var tmp = $.Event('dblclick', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey }); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
84 $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
85 }) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
86 .on("click.jstree", ".jstree-leaf > .jstree-ocl", $.proxy(function (e) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
87 e.stopImmediatePropagation(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
88 var tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey }); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
89 $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
90 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
91 .on("mouseover.jstree", ".jstree-wholerow, .jstree-icon", $.proxy(function (e) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
92 e.stopImmediatePropagation(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
93 if(!this.is_disabled(e.currentTarget)) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
94 this.hover_node(e.currentTarget); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
95 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
96 return false; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
97 }, this)) |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
98 .on("mouseleave.jstree", ".jstree-node", $.proxy(function (e) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
99 this.dehover_node(e.currentTarget); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
100 }, this)); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
101 }; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
102 this.teardown = function () { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
103 if(this.settings.wholerow) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
104 this.element.find(".jstree-wholerow").remove(); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
105 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
106 parent.teardown.call(this); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
107 }; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
108 this.redraw_node = function(obj, deep, callback, force_render) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
109 obj = parent.redraw_node.apply(this, arguments); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
110 if(obj) { |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
111 var tmp = div.cloneNode(true); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
112 //tmp.style.height = this._data.core.li_height + 'px'; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
113 if($.inArray(obj.id, this._data.core.selected) !== -1) { tmp.className += ' jstree-wholerow-clicked'; } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
114 if(this._data.core.focused && this._data.core.focused === obj.id) { tmp.className += ' jstree-wholerow-hovered'; } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
115 obj.insertBefore(tmp, obj.childNodes[0]); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
116 } |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
117 return obj; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
118 }; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
119 }; |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
120 // include the wholerow plugin by default |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
121 // $.jstree.defaults.plugins.push("wholerow"); |
32210899a3dd
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
mingchen0919
parents:
diff
changeset
|
122 })); |