@checksub_team/peaks_timeline 1.4.26 → 1.4.29

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.
@@ -136,7 +136,9 @@ define([
136
136
  options.textColor || '#000000',
137
137
  options.handleTextColor || '#000000',
138
138
  options.opacity || 1,
139
- true // editable
139
+ true, // editable
140
+ options.allowDeletion || false,
141
+ options.line
140
142
  );
141
143
 
142
144
  return segment;
@@ -156,8 +158,8 @@ define([
156
158
  * Add segments to the given line so they can be displayed.
157
159
  */
158
160
 
159
- TimelineSegments.prototype.addSegmentsToPosition = function(position) {
160
- this._peaks.emit('segments.show', position);
161
+ TimelineSegments.prototype.addSegmentsToPosition = function(lineId, position) {
162
+ this._peaks.emit('segments.show', lineId, position);
161
163
  };
162
164
 
163
165
  /**
@@ -379,10 +381,10 @@ define([
379
381
  * <code>segments.remove_all</code> event.
380
382
  */
381
383
 
382
- TimelineSegments.prototype.removeAll = function() {
384
+ TimelineSegments.prototype.removeAll = function(lineId) {
383
385
  this._segments = [];
384
386
  this._segmentsById = {};
385
- this._peaks.emit('segments.remove_all');
387
+ this._peaks.emit('segments.remove_all', lineId);
386
388
  };
387
389
 
388
390
  return TimelineSegments;
@@ -131,7 +131,7 @@ define([
131
131
  self._playheadLayer = new PlayheadLayer(
132
132
  peaks,
133
133
  self,
134
- self._sourcesLayer.getSegmentsGroup(),
134
+ self._sourcesLayer,
135
135
  self._options.showPlayheadTime
136
136
  );
137
137
 
@@ -361,6 +361,18 @@ define([
361
361
  this._sourcesLayer.draw();
362
362
  };
363
363
 
364
+ TimelineZoomView.prototype.selectSourceById = function(sourceId) {
365
+ var sourceGroup = this._sourcesLayer.getSourceGroupById(sourceId);
366
+
367
+ if (sourceGroup) {
368
+ this._modeLayer.selectElement(sourceGroup, false);
369
+ }
370
+ };
371
+
372
+ TimelineZoomView.prototype.deselectElement = function() {
373
+ this._modeLayer.deselectElement(false);
374
+ };
375
+
364
376
  TimelineZoomView.prototype.isListening = function() {
365
377
  return this._stage.listening();
366
378
  };