Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3bebc9d9 authored by Robin Tissot's avatar Robin Tissot
Browse files

Zoom in transcription window.

parent d2b47adf
No related tags found
No related merge requests found
...@@ -288,6 +288,9 @@ class TranscriptionPanel extends Panel { ...@@ -288,6 +288,9 @@ class TranscriptionPanel extends Panel {
$('#trans-modal #trans-input .ql-editor').html($('.js-version-content', $tr).html()); $('#trans-modal #trans-input .ql-editor').html($('.js-version-content', $tr).html());
}); });
this.$container = $('.img-container', this.$panel);
WheelZoom(this.$container, false, 1, 1);
editor = new Quill('#trans-input', { editor = new Quill('#trans-input', {
theme: 'bubble', theme: 'bubble',
...@@ -328,7 +331,9 @@ class TranscriptionPanel extends Panel { ...@@ -328,7 +331,9 @@ class TranscriptionPanel extends Panel {
this.addLine(this.part.lines[i]); this.addLine(this.part.lines[i]);
} }
super.load(part); super.load(part);
this.$panel.css('min-height', this.bottom*this.ratio+20);
$('.zoom-container', this.$container).css('height', this.bottom*this.ratio+20);
this.$container.trigger('wheelzoom.refresh');
} }
reset() { reset() {
...@@ -339,6 +344,7 @@ class TranscriptionPanel extends Panel { ...@@ -339,6 +344,7 @@ class TranscriptionPanel extends Panel {
this.lines[i].setPosition(); this.lines[i].setPosition();
} }
} }
this.$panel.css('min-height', this.bottom*this.ratio+20); $('.zoom-container', this.$container).css('height', this.bottom*this.ratio+20);
this.$container.trigger('wheelzoom.refresh');
} }
} }
...@@ -8,7 +8,7 @@ function WheelZoom(container, disabled_, initial_scale, min_scale_opt, max_scale ...@@ -8,7 +8,7 @@ function WheelZoom(container, disabled_, initial_scale, min_scale_opt, max_scale
var zoom_target = {x:0, y:0}; var zoom_target = {x:0, y:0};
var zoom_point = {x:0, y:0}; var zoom_point = {x:0, y:0};
var previousEvent; var previousEvent;
var disabled = disabled_; var disabled = disabled_ || target.height() === 0;
target.css({transformOrigin: '0 0', transition: 'transform 0.3s', cursor: 'zoom-in'}); target.css({transformOrigin: '0 0', transition: 'transform 0.3s', cursor: 'zoom-in'});
container.on("mousewheel DOMMouseScroll", scrolled); container.on("mousewheel DOMMouseScroll", scrolled);
container.on('mousedown', draggable); container.on('mousedown', draggable);
...@@ -112,6 +112,7 @@ function WheelZoom(container, disabled_, initial_scale, min_scale_opt, max_scale ...@@ -112,6 +112,7 @@ function WheelZoom(container, disabled_, initial_scale, min_scale_opt, max_scale
function refresh() { function refresh() {
size = {w: target.width(), h: target.height()}; size = {w: target.width(), h: target.height()};
disabled = disabled_ || target.height() === 0;
api.min_scale = min_scale_opt || Math.min( api.min_scale = min_scale_opt || Math.min(
$(window).width() / (size.w * initial_scale) * 0.9, $(window).width() / (size.w * initial_scale) * 0.9,
$(window).height() / (size.h * initial_scale) * 0.9); $(window).height() / (size.h * initial_scale) * 0.9);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment