|
13 | 13 | }(function ($, undefined) { |
14 | 14 | "use strict"; |
15 | 15 | /*! |
16 | | - * jsTree 3.3.16 |
| 16 | + * jsTree 3.3.17 |
17 | 17 | * http://jstree.com/ |
18 | 18 | * |
19 | 19 | * Copyright (c) 2014 Ivan Bozhanov (http://vakata.com) |
|
63 | 63 | * specifies the jstree version in use |
64 | 64 | * @name $.jstree.version |
65 | 65 | */ |
66 | | - version : '3.3.16', |
| 66 | + version : '3.3.17', |
67 | 67 | /** |
68 | 68 | * holds all the default options used when creating new instances |
69 | 69 | * @name $.jstree.defaults |
|
4582 | 4582 | "lineHeight" : (this._data.core.li_height) + "px", |
4583 | 4583 | "width" : "150px" // will be set a bit further down |
4584 | 4584 | }, |
4585 | | - "blur" : function (e) { |
4586 | | - e.stopImmediatePropagation(); |
4587 | | - e.preventDefault(); |
4588 | | - var i = s.children(".jstree-rename-input"), |
4589 | | - v = i.val(), |
4590 | | - f = this.settings.core.force_text, |
4591 | | - nv; |
4592 | | - if(v === "") { v = t; } |
4593 | | - h1.remove(); |
4594 | | - s.replaceWith(a); |
4595 | | - s.remove(); |
4596 | | - t = f ? t : $('<div></div>').append($.parseHTML(t)).html(); |
4597 | | - obj = this.get_node(obj); |
4598 | | - this.set_text(obj, t); |
4599 | | - nv = !!this.rename_node(obj, f ? $('<div></div>').text(v).text() : $('<div></div>').append($.parseHTML(v)).html()); |
4600 | | - if(!nv) { |
4601 | | - this.set_text(obj, t); // move this up? and fix #483 |
4602 | | - } |
4603 | | - this._data.core.focused = tmp.id; |
4604 | | - setTimeout(function () { |
4605 | | - var node = this.get_node(tmp.id, true); |
4606 | | - if(node.length) { |
4607 | | - this._data.core.focused = tmp.id; |
4608 | | - node.children('.jstree-anchor').trigger('focus'); |
4609 | | - } |
4610 | | - }.bind(this), 0); |
4611 | | - if(callback) { |
4612 | | - callback.call(this, tmp, nv, cancel, v); |
4613 | | - } |
4614 | | - h2 = null; |
4615 | | - }.bind(this), |
4616 | | - "keydown" : function (e) { |
4617 | | - var key = e.which; |
4618 | | - if(key === 27) { |
4619 | | - cancel = true; |
4620 | | - this.value = t; |
4621 | | - } |
4622 | | - if(key === 27 || key === 13 || key === 37 || key === 38 || key === 39 || key === 40 || key === 32) { |
| 4585 | + "on" : { |
| 4586 | + "blur" : function (e) { |
4623 | 4587 | e.stopImmediatePropagation(); |
4624 | | - } |
4625 | | - if(key === 27 || key === 13) { |
4626 | 4588 | e.preventDefault(); |
4627 | | - this.blur(); |
| 4589 | + var i = s.children(".jstree-rename-input"), |
| 4590 | + v = i.val(), |
| 4591 | + f = this.settings.core.force_text, |
| 4592 | + nv; |
| 4593 | + if(v === "") { v = t; } |
| 4594 | + h1.remove(); |
| 4595 | + s.replaceWith(a); |
| 4596 | + s.remove(); |
| 4597 | + t = f ? t : $('<div></div>').append($.parseHTML(t)).html(); |
| 4598 | + obj = this.get_node(obj); |
| 4599 | + this.set_text(obj, t); |
| 4600 | + nv = !!this.rename_node(obj, f ? $('<div></div>').text(v).text() : $('<div></div>').append($.parseHTML(v)).html()); |
| 4601 | + if(!nv) { |
| 4602 | + this.set_text(obj, t); // move this up? and fix #483 |
| 4603 | + } |
| 4604 | + this._data.core.focused = tmp.id; |
| 4605 | + setTimeout(function () { |
| 4606 | + var node = this.get_node(tmp.id, true); |
| 4607 | + if(node.length) { |
| 4608 | + this._data.core.focused = tmp.id; |
| 4609 | + node.children('.jstree-anchor').trigger('focus'); |
| 4610 | + } |
| 4611 | + }.bind(this), 0); |
| 4612 | + if(callback) { |
| 4613 | + callback.call(this, tmp, nv, cancel, v); |
| 4614 | + } |
| 4615 | + h2 = null; |
| 4616 | + }.bind(this), |
| 4617 | + "keydown" : function (e) { |
| 4618 | + var key = e.which; |
| 4619 | + if(key === 27) { |
| 4620 | + cancel = true; |
| 4621 | + this.value = t; |
| 4622 | + } |
| 4623 | + if(key === 27 || key === 13 || key === 37 || key === 38 || key === 39 || key === 40 || key === 32) { |
| 4624 | + e.stopImmediatePropagation(); |
| 4625 | + } |
| 4626 | + if(key === 27 || key === 13) { |
| 4627 | + e.preventDefault(); |
| 4628 | + this.blur(); |
| 4629 | + } |
| 4630 | + }, |
| 4631 | + "click" : function (e) { e.stopImmediatePropagation(); }, |
| 4632 | + "mousedown" : function (e) { e.stopImmediatePropagation(); }, |
| 4633 | + "keyup" : function (e) { |
| 4634 | + h2.width(Math.min(h1.text("pW" + this.value).width(),w)); |
| 4635 | + }, |
| 4636 | + "keypress" : function(e) { |
| 4637 | + if(e.which === 13) { return false; } |
4628 | 4638 | } |
4629 | | - }, |
4630 | | - "click" : function (e) { e.stopImmediatePropagation(); }, |
4631 | | - "mousedown" : function (e) { e.stopImmediatePropagation(); }, |
4632 | | - "keyup" : function (e) { |
4633 | | - h2.width(Math.min(h1.text("pW" + this.value).width(),w)); |
4634 | | - }, |
4635 | | - "keypress" : function(e) { |
4636 | | - if(e.which === 13) { return false; } |
4637 | 4639 | } |
4638 | 4640 | }); |
4639 | 4641 | fn = { |
|
6152 | 6154 | "_disabled" : false, //(this.check("rename_node", data.reference, this.get_parent(data.reference), "")), |
6153 | 6155 | "label" : "Rename", |
6154 | 6156 | /*! |
6155 | | - "shortcut" : 113, |
6156 | | - "shortcut_label" : 'F2', |
6157 | | - "icon" : "glyphicon glyphicon-leaf", |
6158 | | - */ |
| 6157 | + "shortcut" : 113, |
| 6158 | + "shortcut_label" : 'F2', |
| 6159 | + "icon" : "glyphicon glyphicon-leaf", |
| 6160 | + */ |
6159 | 6161 | "action" : function (data) { |
6160 | 6162 | var inst = $.jstree.reference(data.reference), |
6161 | 6163 | obj = inst.get_node(data.reference); |
|
6291 | 6293 | }); |
6292 | 6294 |
|
6293 | 6295 | /*! |
6294 | | - if(!('oncontextmenu' in document.body) && ('ontouchstart' in document.body)) { |
6295 | | - var el = null, tm = null; |
6296 | | - this.element |
6297 | | - .on("touchstart", ".jstree-anchor", function (e) { |
6298 | | - el = e.currentTarget; |
6299 | | - tm = +new Date(); |
6300 | | - $(document).one("touchend", function (e) { |
6301 | | - e.target = document.elementFromPoint(e.originalEvent.targetTouches[0].pageX - window.pageXOffset, e.originalEvent.targetTouches[0].pageY - window.pageYOffset); |
6302 | | - e.currentTarget = e.target; |
6303 | | - tm = ((+(new Date())) - tm); |
6304 | | - if(e.target === el && tm > 600 && tm < 1000) { |
6305 | | - e.preventDefault(); |
6306 | | - $(el).trigger('contextmenu', e); |
6307 | | - } |
6308 | | - el = null; |
6309 | | - tm = null; |
6310 | | - }); |
6311 | | - }); |
6312 | | - } |
6313 | | - */ |
| 6296 | + if(!('oncontextmenu' in document.body) && ('ontouchstart' in document.body)) { |
| 6297 | + var el = null, tm = null; |
| 6298 | + this.element |
| 6299 | + .on("touchstart", ".jstree-anchor", function (e) { |
| 6300 | + el = e.currentTarget; |
| 6301 | + tm = +new Date(); |
| 6302 | + $(document).one("touchend", function (e) { |
| 6303 | + e.target = document.elementFromPoint(e.originalEvent.targetTouches[0].pageX - window.pageXOffset, e.originalEvent.targetTouches[0].pageY - window.pageYOffset); |
| 6304 | + e.currentTarget = e.target; |
| 6305 | + tm = ((+(new Date())) - tm); |
| 6306 | + if(e.target === el && tm > 600 && tm < 1000) { |
| 6307 | + e.preventDefault(); |
| 6308 | + $(el).trigger('contextmenu', e); |
| 6309 | + } |
| 6310 | + el = null; |
| 6311 | + tm = null; |
| 6312 | + }); |
| 6313 | + }); |
| 6314 | + } |
| 6315 | + */ |
6314 | 6316 | $(document).on("context_hide.vakata.jstree", function (e, data) { |
6315 | 6317 | this._data.contextmenu.visible = false; |
6316 | 6318 | $(data.reference).removeClass('jstree-context'); |
|
8661 | 8663 | } |
8662 | 8664 | }.bind(this)) |
8663 | 8665 | /*! |
8664 | | - .on("mousedown.jstree touchstart.jstree", ".jstree-wholerow", function (e) { |
8665 | | - if(e.target === e.currentTarget) { |
8666 | | - var a = $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor"); |
8667 | | - e.target = a[0]; |
8668 | | - a.trigger(e); |
8669 | | - } |
8670 | | - }) |
8671 | | - */ |
| 8666 | + .on("mousedown.jstree touchstart.jstree", ".jstree-wholerow", function (e) { |
| 8667 | + if(e.target === e.currentTarget) { |
| 8668 | + var a = $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor"); |
| 8669 | + e.target = a[0]; |
| 8670 | + a.trigger(e); |
| 8671 | + } |
| 8672 | + }) |
| 8673 | + */ |
8672 | 8674 | .on("click.jstree", ".jstree-wholerow", function (e) { |
8673 | 8675 | e.stopImmediatePropagation(); |
8674 | 8676 | var tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey }); |
|
0 commit comments