Skip to content

Commit

Permalink
Removed code duplication
Browse files Browse the repository at this point in the history
WaveformZoomView and WaveformOverview now inherit
a common base class, WaveformView
  • Loading branch information
chrisn committed Sep 21, 2023
1 parent 6b03d2d commit 03983f4
Show file tree
Hide file tree
Showing 6 changed files with 578 additions and 935 deletions.
12 changes: 8 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ const defaultZoomviewOptions = {
waveformColor: 'rgba(0, 225, 128, 1)',
wheelMode: 'none',
autoScroll: true,
autoScrollOffset: 100
autoScrollOffset: 100,
enableEditing: true
};

const defaultOverviewOptions = {
Expand All @@ -98,7 +99,8 @@ const defaultOverviewOptions = {
highlightStrokeColor: 'transparent',
highlightOpacity: 0.3,
highlightOffset: 11,
highlightCornerRadius: 2
highlightCornerRadius: 2,
enableEditing: false
};

const defaultSegmentOptions = {
Expand Down Expand Up @@ -157,7 +159,8 @@ function getOverviewOptions(opts) {
'highlightCornerRadius',
'highlightOffset',
'enablePoints',
'enableSegments'
'enableSegments',
'enableEditing'
];

optNames.forEach(function(optName) {
Expand Down Expand Up @@ -212,7 +215,8 @@ function getZoomviewOptions(opts) {
'autoScroll',
'autoScrollOffset',
'enablePoints',
'enableSegments'
'enableSegments',
'enableEditing'
];

optNames.forEach(function(optName) {
Expand Down
Loading

0 comments on commit 03983f4

Please sign in to comment.