some minor changes
This commit is contained in:
parent
84c015ee93
commit
ad15c8a85f
|
@ -1032,7 +1032,7 @@ treemode._onMultiSelect = function (event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// deselect previous selection
|
// deselect previous selection
|
||||||
this.deselect(false, false);
|
this.deselect();
|
||||||
|
|
||||||
// find the selected nodes in the range from first to last
|
// find the selected nodes in the range from first to last
|
||||||
var start = this.multiselection.start;
|
var start = this.multiselection.start;
|
||||||
|
@ -1073,9 +1073,8 @@ treemode._onMultiSelectEnd = function (event) {
|
||||||
* deselect currently selected nodes
|
* deselect currently selected nodes
|
||||||
* @param {boolean} [clearStartAndEnd=false] If true, the `start` and `end`
|
* @param {boolean} [clearStartAndEnd=false] If true, the `start` and `end`
|
||||||
* state is cleared too.
|
* state is cleared too.
|
||||||
* @param {boolean} [noChangeEvent=false] If true, do not emit onSelectionChanged event
|
|
||||||
*/
|
*/
|
||||||
treemode.deselect = function (clearStartAndEnd, noChangeEvent) {
|
treemode.deselect = function (clearStartAndEnd) {
|
||||||
var selectionChanged = !!this.multiselection.nodes.length;
|
var selectionChanged = !!this.multiselection.nodes.length;
|
||||||
this.multiselection.nodes.forEach(function (node) {
|
this.multiselection.nodes.forEach(function (node) {
|
||||||
node.setSelected(false);
|
node.setSelected(false);
|
||||||
|
@ -1087,7 +1086,7 @@ treemode.deselect = function (clearStartAndEnd, noChangeEvent) {
|
||||||
this.multiselection.end = null;
|
this.multiselection.end = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noChangeEvent && selectionChanged) {
|
if (selectionChanged) {
|
||||||
if (this._selectionChangedHandler) {
|
if (this._selectionChangedHandler) {
|
||||||
this._selectionChangedHandler([]);
|
this._selectionChangedHandler([]);
|
||||||
}
|
}
|
||||||
|
@ -1104,7 +1103,7 @@ treemode.select = function (nodes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodes) {
|
if (nodes) {
|
||||||
this.deselect(false, false);
|
this.deselect();
|
||||||
|
|
||||||
this.multiselection.nodes = nodes.slice(0);
|
this.multiselection.nodes = nodes.slice(0);
|
||||||
|
|
||||||
|
|
|
@ -890,8 +890,8 @@ exports.getInputSelection = function(el) {
|
||||||
/**
|
/**
|
||||||
* Returns the index for certaion position in text element
|
* Returns the index for certaion position in text element
|
||||||
* @param {DOMElement} el A dom element of a textarea or input text.
|
* @param {DOMElement} el A dom element of a textarea or input text.
|
||||||
* @param {Number} row row value, > 0, if exceeds rows number - last row will be considered
|
* @param {Number} row row value, > 0, if exceeds rows number - last row will be returned
|
||||||
* @param {Number} column column value, > 0, if exceeds column length - end of column will be considered
|
* @param {Number} column column value, > 0, if exceeds column length - end of column will be returned
|
||||||
* @returns {Number} index of position in text, -1 if not found
|
* @returns {Number} index of position in text, -1 if not found
|
||||||
*/
|
*/
|
||||||
exports.getIndexForPosition = function(el, row, column) {
|
exports.getIndexForPosition = function(el, row, column) {
|
||||||
|
|
Loading…
Reference in New Issue