Make imageSlider range input use reactive variables instead of updating it manually. Add min/max zoom levels, remove unnecessary precision for Zoom

This commit is contained in:
Erik Ziegler committed 2016-08-14 13:03:10 +02:00
1 parent 5763abf29b
commit 87cc2a5bc0
8 files changed
+43 -66

No files matched your search

@@ -1,7 +1,11 @@
<template name="imageControls">
<div class="imageControls">
<div id="scrollbar">
<input id="imageSlider" type="range" min="1" val="1"/>
<input id="imageSlider"
type="range"
min="1"
value="{{imageIndex}}"
max="{{numImages}}"/>
</div>
</div>
</template>
@@ -1,6 +1,20 @@
const slideTimeoutTime = 40;
let slideTimeout;
Template.imageControls.onRendered(() => {
const instance = Template.instance();
Meteor.defer(() => {
// Set the current imageSlider width to its parent's height
// (because webkit is stupid and can't style vertical sliders)
const $slider = instance.$('#imageSlider');
const $element = $slider.parents().eq(2).siblings('.imageViewerViewport');
const viewportHeight = $element.height();
$slider.width(viewportHeight - 20);
});
})
Template.imageControls.events({
'input #imageSlider, change #imageSlider': function(e) {
// Note that we throttle requests to prevent the
@@ -17,6 +17,7 @@ $imageSliderCursor = grab
padding: 5px
#scrollbar
height: calc(100% - 20px);
margin-top: 5px
width: 31px