Mercurial > hg > orthanc-stone
changeset 2013:dbafd535136e
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 02 Dec 2022 18:52:50 +0100 |
parents | 637d6373127a |
children | a7b5cb068fb8 |
files | Applications/StoneWebViewer/WebApplication/app.js Applications/StoneWebViewer/WebApplication/index.html |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js Fri Dec 02 18:49:06 2022 +0100 +++ b/Applications/StoneWebViewer/WebApplication/app.js Fri Dec 02 18:52:50 2022 +0100 @@ -411,6 +411,12 @@ if (reschedule) { this.cineTimeoutId = setTimeout(this.CineCallback, 1000.0 / this.cineFramesPerSecond); } + }, + ClickVerticalScrollbar: function(event) { + var offset = event.currentTarget.getClientRects()[0]; + var y = event.clientY - offset.top; + var height = event.currentTarget.offsetHeight; + this.currentFrame = Math.min(this.numberOfFrames - 1, Math.floor(y * this.numberOfFrames / (height - 1))); } } });
--- a/Applications/StoneWebViewer/WebApplication/index.html Fri Dec 02 18:49:06 2022 +0100 +++ b/Applications/StoneWebViewer/WebApplication/index.html Fri Dec 02 18:52:50 2022 +0100 @@ -759,7 +759,7 @@ <div v-show="showInfo"> <div v-if="numberOfFrames > 1" class="wvVerticalScrollbar" - v-on:click="var offset = $event.currentTarget.getClientRects()[0]; var y = $event.clientY - offset.top; var height = $event.currentTarget.offsetHeight; currentFrame = Math.min(numberOfFrames - 1, Math.floor(y * numberOfFrames / (height - 1)));"> + v-on:click="ClickVerticalScrollbar($event)"> <div class="wvVerticalScrollbarHighlight" v-bind:style="{ top: (currentFrame / (numberOfFrames - 1) * 95.0) + '%' }"> </div>