-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #936 from kecnry/mosviz-table-row-select
Mosviz: table row select/scroll
- Loading branch information
Showing
7 changed files
with
154 additions
and
1 deletion.
There are no files selected for viewing
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
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
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,76 @@ | ||
<template> | ||
<v-toolbar-items :class="{active: activeInterval}"> | ||
<j-tooltip tipid='table-play-pause-toggle'> | ||
<v-btn icon @click="togglePlayPause" color="white"> | ||
<v-icon>mdi-play-pause</v-icon> | ||
</v-btn> | ||
</j-tooltip> | ||
<j-tooltip tipid='table-play-pause-delay'> | ||
<v-text-field | ||
v-model="delaySeconds" | ||
type="number" | ||
min="1" | ||
max="60" | ||
@change="changeDelay" | ||
@mousedown="changeDelay" | ||
class="mt-0 pt-0 theme--dark" | ||
style="width: 60px" | ||
hide-details | ||
single-line | ||
filled | ||
dense | ||
/> | ||
</j-tooltip> | ||
</v-toolbar-items> | ||
</template> | ||
|
||
<script> | ||
//var activeInterval = null; | ||
module.exports = { | ||
data: function () { | ||
return { | ||
activeInterval: null, | ||
delaySeconds: 2 | ||
} | ||
}, | ||
props: [], | ||
methods: { | ||
eachIteration() { | ||
this.$emit('event') | ||
}, | ||
clearActiveInterval() { | ||
if (this.activeInterval) { | ||
clearInterval(this.activeInterval) | ||
} | ||
this.activeInterval = null | ||
}, | ||
createNewInterval() { | ||
this.activeInterval = setInterval(() => this.eachIteration(), this.delaySeconds*1000) | ||
}, | ||
changeDelay(event) { | ||
if (this.delaySeconds <= 0) { | ||
// reject zero and negative values | ||
this.delaySeconds = 1 | ||
} | ||
if (this.activeInterval !== null) { | ||
// then we want to clear the current interval and immediately create a new one, | ||
// while leaving it in the play state | ||
this.clearActiveInterval() | ||
this.createNewInterval() | ||
} | ||
}, | ||
togglePlayPause() { | ||
if (this.activeInterval === null) { | ||
// make sure to call IMMEDIATELY for feedback that something is happening | ||
this.eachIteration() | ||
this.createNewInterval() | ||
} else { | ||
this.clearActiveInterval() | ||
} | ||
}, | ||
} | ||
}; | ||
</script> |
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
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
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
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