From d7946d40986021b70fcab08b45747beae9372c2c Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Fri, 14 Sep 2018 00:10:57 +0200 Subject: [PATCH] fix zoom --- js/conf/ExtensionConf.js | 12 ++++++++++-- js/lib/VideoData.js | 4 ++++ js/modules/PageInfo.js | 11 +++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/js/conf/ExtensionConf.js b/js/conf/ExtensionConf.js index 818cb27..816d5d3 100644 --- a/js/conf/ExtensionConf.js +++ b/js/conf/ExtensionConf.js @@ -171,13 +171,21 @@ var ExtensionConf = { action: "pan", arg: 'toggle' // possible: 'enable', 'disable', 'toggle' }, - "shift": { + "shiftKey_shift": { action: "pan", arg: 'toggle', - keyup: { + keyup: { action: 'pan', arg: 'toggle' } + }, + "shift": { + action: "", + arg: "", + keyup: { + action: 'pan', + arg: 'toggle', + } } //#endregion }, diff --git a/js/lib/VideoData.js b/js/lib/VideoData.js index 2352aba..9bf2481 100644 --- a/js/lib/VideoData.js +++ b/js/lib/VideoData.js @@ -106,6 +106,10 @@ class VideoData { this.resizer.setAr(ar, lastAr); } + resetAr() { + this.resizer.reset(); + } + panHandler(event) { this.resizer.panHandler(event); } diff --git a/js/modules/PageInfo.js b/js/modules/PageInfo.js index 3759e1c..913a33e 100644 --- a/js/modules/PageInfo.js +++ b/js/modules/PageInfo.js @@ -220,9 +220,16 @@ class PageInfo { if(ar !== 'auto') { this.stopArDetection(); } + // TODO: find a way to only change aspect ratio for one video - for(var vd of this.videos){ - vd.setAr(ar) + if (ar === 'reset') { + for (var vd of this.videos) { + vd.resetAr(); + } + } else { + for (var vd of this.videos) { + vd.setAr(ar) + } } }