-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use ww and wl on one range slider * Redo preset selection for new bar * Change range slider values when window is edited by render interaction * Change functions should respect lock state * Locks can be selected to persist for the current scan, experiment, or project * Use a custom range slider for dragging the middle * Use colored locks with letters as lock icon * Flip RAS Axial
- Loading branch information
Showing
8 changed files
with
292 additions
and
170 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<script lang="ts"> | ||
import { VRangeSlider } from 'vuetify/lib'; | ||
export default VRangeSlider.extend({ | ||
methods: { | ||
// override | ||
onSliderMouseDown(e) { | ||
if (e.target.classList.contains('v-slider__track-fill')) { | ||
this._middleDragStart = this.parseMouseMove(e); | ||
} else { | ||
this._middleDragStart = null; | ||
} | ||
VRangeSlider.options.methods.onSliderMouseDown.call(this, e); | ||
}, | ||
// override | ||
onSliderClick() { | ||
// do nothing on click | ||
}, | ||
// override | ||
onMouseMove(e) { | ||
const value = this.parseMouseMove(e); | ||
if (e.type === 'mousemove') { | ||
this.thumbPressed = true; | ||
} | ||
if (this._middleDragStart != null) { | ||
const delta = value - this._middleDragStart; | ||
this.applyRangeDelta(delta); | ||
} else { | ||
if (this.activeThumb === null) { | ||
this.activeThumb = this.getIndexOfClosestValue( | ||
this.internalValue, | ||
value, | ||
); | ||
} | ||
this.setInternalValue(value); | ||
} | ||
}, | ||
// override | ||
applyRangeDelta(delta) { | ||
// this.oldValue is from VRangeSlider::onSliderMouseDown | ||
let [low, high] = this.oldValue; | ||
// assumption: min <= low < high <= max | ||
if (low + delta < this.min) { | ||
high -= low - this.min; | ||
low = this.min; | ||
} else if (high + delta > this.max) { | ||
low += this.max - high; | ||
high = this.max; | ||
} else { | ||
low += delta; | ||
high += delta; | ||
} | ||
this.internalValue = [low, high]; | ||
}, | ||
}, | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
.v-slider--horizontal .v-slider__track-container { | ||
height: 5px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
.v-slider__track-fill:hover { | ||
cursor: grab; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.