@checksub_team/peaks_timeline 1.9.2 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/peaks.js +20 -14
- package/src/mode-layer.js +21 -14
- package/src/timeline-zoomview.js +1 -1
package/package.json
CHANGED
package/peaks.js
CHANGED
|
@@ -15743,15 +15743,17 @@ module.exports = function (Utils, Source, SourceGroup, Konva) {
|
|
|
15743
15743
|
const sources = [];
|
|
15744
15744
|
const segments = [];
|
|
15745
15745
|
const self = this;
|
|
15746
|
-
this.
|
|
15746
|
+
this.deselectDifference(elements, true);
|
|
15747
15747
|
elements.forEach(function (element) {
|
|
15748
|
-
self._selectedElements[element.id]
|
|
15749
|
-
|
|
15750
|
-
|
|
15751
|
-
if (
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
|
|
15748
|
+
if (!self._selectedElements[element.id]) {
|
|
15749
|
+
self._selectedElements[element.id] = element;
|
|
15750
|
+
element.setSelected(true);
|
|
15751
|
+
if (notify) {
|
|
15752
|
+
if (element instanceof Source) {
|
|
15753
|
+
sources.push(element);
|
|
15754
|
+
} else {
|
|
15755
|
+
segments.push(element);
|
|
15756
|
+
}
|
|
15755
15757
|
}
|
|
15756
15758
|
}
|
|
15757
15759
|
});
|
|
@@ -15764,10 +15766,14 @@ module.exports = function (Utils, Source, SourceGroup, Konva) {
|
|
|
15764
15766
|
}
|
|
15765
15767
|
}
|
|
15766
15768
|
};
|
|
15767
|
-
ModeLayer.prototype.
|
|
15769
|
+
ModeLayer.prototype.deselectDifference = function (newElements, notify) {
|
|
15768
15770
|
const sources = [];
|
|
15769
15771
|
const segments = [];
|
|
15770
|
-
|
|
15772
|
+
const selectedElementsToDeselect = Object.assign({}, this._selectedElements);
|
|
15773
|
+
newElements.forEach(function (element) {
|
|
15774
|
+
delete selectedElementsToDeselect[element.id];
|
|
15775
|
+
});
|
|
15776
|
+
for (var id in selectedElementsToDeselect) {
|
|
15771
15777
|
if (Utils.objectHasProperty(this._selectedElements, id)) {
|
|
15772
15778
|
const element = this._selectedElements[id];
|
|
15773
15779
|
element.setSelected(false);
|
|
@@ -15850,7 +15856,7 @@ module.exports = function (Utils, Source, SourceGroup, Konva) {
|
|
|
15850
15856
|
this.selectElements([hoveredKonvaElement.getSegment()], true);
|
|
15851
15857
|
}
|
|
15852
15858
|
} else {
|
|
15853
|
-
this.
|
|
15859
|
+
this.deselectDifference([], true);
|
|
15854
15860
|
this._view.drawSourcesLayer();
|
|
15855
15861
|
}
|
|
15856
15862
|
};
|
|
@@ -15858,7 +15864,7 @@ module.exports = function (Utils, Source, SourceGroup, Konva) {
|
|
|
15858
15864
|
const selectedElements = Object.values(this._selectedElements);
|
|
15859
15865
|
if (selectedElements.length) {
|
|
15860
15866
|
var selectedElement = selectedElements[0];
|
|
15861
|
-
this.
|
|
15867
|
+
this.deselectDifference([], true);
|
|
15862
15868
|
if (selectedElement instanceof Source) {
|
|
15863
15869
|
if (selectedElement.isDeletable()) {
|
|
15864
15870
|
this._peaks.destroySource(selectedElement.id);
|
|
@@ -16004,7 +16010,7 @@ module.exports = function (Utils, Source, SourceGroup, Konva) {
|
|
|
16004
16010
|
this._peaks.off('keyboard.delete', this._onKeyboardDelete);
|
|
16005
16011
|
break;
|
|
16006
16012
|
}
|
|
16007
|
-
this.
|
|
16013
|
+
this.deselectDifference([], true);
|
|
16008
16014
|
switch (mode) {
|
|
16009
16015
|
case 'cut':
|
|
16010
16016
|
this._stage.on('mouseover', this._onMouseEnterInCutMode);
|
|
@@ -20230,7 +20236,7 @@ module.exports = function (MouseDragHandler, PlayheadLayer, SourcesLayer, ModeLa
|
|
|
20230
20236
|
}
|
|
20231
20237
|
};
|
|
20232
20238
|
TimelineZoomView.prototype.deselectAll = function () {
|
|
20233
|
-
this._modeLayer.
|
|
20239
|
+
this._modeLayer.deselectDifference([], false);
|
|
20234
20240
|
};
|
|
20235
20241
|
TimelineZoomView.prototype.isListening = function () {
|
|
20236
20242
|
return this._stage.listening();
|
package/src/mode-layer.js
CHANGED
|
@@ -72,17 +72,19 @@ define([
|
|
|
72
72
|
const segments = [];
|
|
73
73
|
const self = this;
|
|
74
74
|
|
|
75
|
-
this.
|
|
75
|
+
this.deselectDifference(elements, true);
|
|
76
76
|
|
|
77
77
|
elements.forEach(function(element) {
|
|
78
|
-
self._selectedElements[element.id]
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
if (!self._selectedElements[element.id]) {
|
|
79
|
+
self._selectedElements[element.id] = element;
|
|
80
|
+
element.setSelected(true);
|
|
81
|
+
if (notify) {
|
|
82
|
+
if (element instanceof Source) {
|
|
83
|
+
sources.push(element);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
segments.push(element);
|
|
87
|
+
}
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
});
|
|
@@ -97,11 +99,16 @@ define([
|
|
|
97
99
|
}
|
|
98
100
|
};
|
|
99
101
|
|
|
100
|
-
ModeLayer.prototype.
|
|
102
|
+
ModeLayer.prototype.deselectDifference = function(newElements, notify) {
|
|
101
103
|
const sources = [];
|
|
102
104
|
const segments = [];
|
|
105
|
+
const selectedElementsToDeselect = Object.assign({}, this._selectedElements);
|
|
106
|
+
|
|
107
|
+
newElements.forEach(function(element) {
|
|
108
|
+
delete selectedElementsToDeselect[element.id];
|
|
109
|
+
});
|
|
103
110
|
|
|
104
|
-
for (var id in
|
|
111
|
+
for (var id in selectedElementsToDeselect) {
|
|
105
112
|
if (Utils.objectHasProperty(this._selectedElements, id)) {
|
|
106
113
|
const element = this._selectedElements[id];
|
|
107
114
|
|
|
@@ -198,7 +205,7 @@ define([
|
|
|
198
205
|
}
|
|
199
206
|
}
|
|
200
207
|
else {
|
|
201
|
-
this.
|
|
208
|
+
this.deselectDifference([], true);
|
|
202
209
|
this._view.drawSourcesLayer(); // Redraw sources layer to remove selection
|
|
203
210
|
}
|
|
204
211
|
};
|
|
@@ -210,7 +217,7 @@ define([
|
|
|
210
217
|
if (selectedElements.length) {
|
|
211
218
|
var selectedElement = selectedElements[0];
|
|
212
219
|
|
|
213
|
-
this.
|
|
220
|
+
this.deselectDifference([], true);
|
|
214
221
|
|
|
215
222
|
if (selectedElement instanceof Source) {
|
|
216
223
|
if (selectedElement.isDeletable()) {
|
|
@@ -426,7 +433,7 @@ define([
|
|
|
426
433
|
break;
|
|
427
434
|
}
|
|
428
435
|
|
|
429
|
-
this.
|
|
436
|
+
this.deselectDifference([], true);
|
|
430
437
|
|
|
431
438
|
// Set new mode
|
|
432
439
|
switch (mode) {
|
package/src/timeline-zoomview.js
CHANGED