comparison Applications/StoneWebViewer/WebApplication/app.js @ 1968:ed5a0b9183dc

The text field with the instance number is editable to go to a specific instance
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 28 Oct 2022 10:56:34 +0200
parents b180233143ae
children 0aac8f552d89
comparison
equal deleted inserted replaced
1967:b180233143ae 1968:ed5a0b9183dc
139 data: function () { 139 data: function () {
140 return { 140 return {
141 stone: stone, // To access global object "stone" from "index.html" 141 stone: stone, // To access global object "stone" from "index.html"
142 status: 'waiting', 142 status: 'waiting',
143 currentFrame: 0, 143 currentFrame: 0,
144 currentFrameFromUser: 0,
144 numberOfFrames: 0, 145 numberOfFrames: 0,
145 quality: '', 146 quality: '',
146 cineControls: false, 147 cineControls: false,
147 cineIncrement: 0, 148 cineIncrement: 0,
148 cineFramesPerSecond: 30, 149 cineFramesPerSecond: 30,
156 contentTime: '', 157 contentTime: '',
157 } 158 }
158 }, 159 },
159 watch: { 160 watch: {
160 currentFrame: function(newVal, oldVal) { 161 currentFrame: function(newVal, oldVal) {
162 this.currentFrameFromUser = newVal + 1;
161 if (this.cineLoadingFrame) { 163 if (this.cineLoadingFrame) {
162 /** 164 /**
163 * The "FrameUpdated" event has been received, which indicates 165 * The "FrameUpdated" event has been received, which indicates
164 * that the schedule frame has been displayed: The cine loop can 166 * that the schedule frame has been displayed: The cine loop can
165 * proceed to the next frame (check out "CineCallback()"). 167 * proceed to the next frame (check out "CineCallback()").
166 **/ 168 **/
167 this.cineLoadingFrame = false; 169 this.cineLoadingFrame = false;
168 } else { 170 } else {
169 stone.SetFrame(this.canvasId, newVal); 171 stone.SetFrame(this.canvasId, newVal);
172 }
173 },
174 currentFrameFromUser: function(newVal, oldVal) {
175 if (parseInt(newVal, 10) !== NaN &&
176 newVal >= 1 &&
177 newVal <= this.numberOfFrames) {
178 this.currentFrame = this.currentFrameFromUser - 1;
170 } 179 }
171 }, 180 },
172 content: function(newVal, oldVal) { 181 content: function(newVal, oldVal) {
173 this.status = 'loading'; 182 this.status = 'loading';
174 this.cineControls = false; 183 this.cineControls = false;