@checksub_team/peaks_timeline 1.4.23 → 1.4.24

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksub_team/peaks_timeline",
3
- "version": "1.4.23",
3
+ "version": "1.4.24",
4
4
  "description": "JavaScript UI component for displaying audio waveforms",
5
5
  "main": "./peaks.js",
6
6
  "types": "./peaks.js.d.ts",
package/peaks.js CHANGED
@@ -15419,7 +15419,8 @@ module.exports = function (Colors, EventEmitter, TimelineSegments, TimelineSourc
15419
15419
  autoScrollThreshold: 0.05,
15420
15420
  enableLineIndicatorContextMenu: true,
15421
15421
  minSourceSize: 0.05,
15422
- minSegmentSize: 0.2
15422
+ minSegmentSize: 0.2,
15423
+ canMoveSourcesBetweenLines: true
15423
15424
  };
15424
15425
  this.logger = console.error.bind(console);
15425
15426
  return this;
@@ -18648,7 +18649,9 @@ module.exports = function (SourceGroup, SegmentsGroup, Lines, DataRetriever, Uti
18648
18649
  endX: newEndX,
18649
18650
  updateWidth: false
18650
18651
  };
18651
- this.manageVerticalPosition(source, newY);
18652
+ if (this._peaks.options.canMoveSourcesBetweenLines) {
18653
+ this.manageVerticalPosition(source, newY);
18654
+ }
18652
18655
  newXs = this.manageSourceOrder(source, newStartX, newEndX);
18653
18656
  newXs = this.manageCollision(source, newXs.startX, newXs.endX);
18654
18657
  source.updateTimes(newXs.startX !== null ? this._view.pixelsToTime(newXs.startX) : null, newXs.endX !== null ? this._view.pixelsToTime(newXs.endX) : null);
package/src/main.js CHANGED
@@ -310,7 +310,13 @@ define([
310
310
  /**
311
311
  * The minimal size of a segment, in seconds
312
312
  */
313
- minSegmentSize: 0.2
313
+ minSegmentSize: 0.2,
314
+
315
+ /**
316
+ * Indicates whether or not sources can be dragged
317
+ * from one line to another
318
+ */
319
+ canMoveSourcesBetweenLines: true
314
320
  };
315
321
 
316
322
  /**
@@ -297,7 +297,9 @@ define([
297
297
  updateWidth: false
298
298
  };
299
299
 
300
- this.manageVerticalPosition(source, newY);
300
+ if (this._peaks.options.canMoveSourcesBetweenLines) {
301
+ this.manageVerticalPosition(source, newY);
302
+ }
301
303
 
302
304
  newXs = this.manageSourceOrder(source, newStartX, newEndX);
303
305