From 1cfdaaeda1206cd8bd08e4c8482df4a2857243fc Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 24 Nov 2014 04:02:01 +0300 Subject: [PATCH] some minor changes and tweaks... Signed-off-by: Alex A. Naanou --- ui (gen4)/images.js | 2 +- ui (gen4)/index.html | 30 +++++++++++++++--------------- ui (gen4)/lib/actions.js | 10 +++++----- ui (gen4)/viewer.js | 27 +++++++++++++++++++-------- 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/ui (gen4)/images.js b/ui (gen4)/images.js index 22eeedb8..bc1ace03 100755 --- a/ui (gen4)/images.js +++ b/ui (gen4)/images.js @@ -407,7 +407,7 @@ module.ImagesPrototype = { //size = size == null ? getVisibleImageSize('max') : size img_data = img_data == null ? this[gid] : img_data - // XXX if no usable images are available use STUB data... + // if no usable images are available use STUB data... if((img_data.preview == null || Object.keys(img_data.preview).length == 0) && img_data.path == null){ diff --git a/ui (gen4)/index.html b/ui (gen4)/index.html index 31d978cb..92f63cf3 100755 --- a/ui (gen4)/index.html +++ b/ui (gen4)/index.html @@ -47,29 +47,29 @@ } .viewer:not(.no-transitions) .ribbon-set:not(.no-transitions) { - -webkit-transition: all 0.2s linear, transform 0.2s linear; - -moz-transition: all 0.2s linear, transform 0.2s linear; - -ms-transition: all 0.2s linear, transform 0.2s linear; - -o-transition: all 0.2s linear, transform 0.2s linear; - transition: all 0.2s linear, transform 0.2s linear; + -webkit-transition: all 0.1s linear, transform 0.1s linear; + -moz-transition: all 0.1s linear, transform 0.1s linear; + -ms-transition: all 0.1s linear, transform 0.1s linear; + -o-transition: all 0.1s linear, transform 0.1s linear; + transition: all 0.1s linear, transform 0.1s linear; } .viewer:not(.no-transitions) .ribbon:not(.no-transitions) { - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -ms-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; + -webkit-transition: all 0.1s ease-out; + -moz-transition: all 0.1s ease-out; + -ms-transition: all 0.1s ease-out; + -o-transition: all 0.1s ease-out; + transition: all 0.1s ease-out; } /* XXX not 100% sure about this... */ .current-marker:not(.no-transitions) { - -webkit-transition: left 0.2s ease-out; - -moz-transition: left 0.2s ease-out; - -ms-transition: left 0.2s ease-out; - -o-transition: left 0.2s ease-out; - transition: left 0.2s ease-out; + -webkit-transition: left 0.1s ease-out; + -moz-transition: left 0.1s ease-out; + -ms-transition: left 0.1s ease-out; + -o-transition: left 0.1s ease-out; + transition: left 0.1s ease-out; } /* XXX should this be !important */ diff --git a/ui (gen4)/lib/actions.js b/ui (gen4)/lib/actions.js index 13b9369e..43c1c02c 100755 --- a/ui (gen4)/lib/actions.js +++ b/ui (gen4)/lib/actions.js @@ -568,8 +568,8 @@ module.MetaActions = { // Mixin a set of local actions into an object... // // XXX test - mixinTo: function(to, all, all_attr_types){ - return this.mixin.call(to, this, all, all_attr_types) + mixinTo: function(to, all, descriptors, all_attr_types){ + return this.mixin.call(to, this, all, descriptors, all_attr_types) }, @@ -582,7 +582,7 @@ module.MetaActions = { // // XXX not sure about these... // XXX test - mixout: function(from, all, all_attr_types){ + mixout: function(from, all, descriptors, all_attr_types){ // defaults... descriptors = descriptors || true all_attr_types = all_attr_types || false @@ -624,8 +624,8 @@ module.MetaActions = { // Remove a set of local mixed in actions from object... // // XXX test - mixoutFrom: function(to, all, all_attr_types){ - return this.mixout.call(to, this, all, all_attr_types) + mixoutFrom: function(to, all, descriptors, all_attr_types){ + return this.mixout.call(to, this, all, descriptors, all_attr_types) }, } diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index b14e1684..2115f132 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -862,11 +862,15 @@ actions.Actions(Client, { function(){ // NOTE: the 0.2 is added to compensate for alignment/scaling // errors -- 2.99 images wide counts as 3 while 2.5 as 2. - this.prevImage(Math.floor(this.ribbons.getScreenWidthImages() + 0.2)) + var w = Math.floor(this.ribbons.getScreenWidthImages() + 0.2) + w += (w % 2) - 1 + this.prevImage(w) }], nextScreen: ['Focus next image one screen width away', function(){ - this.nextImage(Math.floor(this.ribbons.getScreenWidthImages() + 0.2)) + var w = Math.floor(this.ribbons.getScreenWidthImages() + 0.2) + w += (w % 2) - 1 + this.nextImage(w) }], // zooming... @@ -1186,10 +1190,13 @@ var PartialRibbonsActions = actions.Actions({ var pa = this.data.getImages(target, size, 'before').length - 1 // do the update... + // the target is not loaded... + if(this.ribbons.getImage(target).length == 0){ + this.resizeRibbon(target, size) + + // do a late resize... // loaded more than we need (crop?)... - if(na + pa < nl + pl - // the target is not loaded... - || this.ribbons.getImage(target).length == 0 + } else if(na + pa < nl + pl // passed threshold on the right... || (nl < threshold && na > nl) // passed threshold on the left... @@ -1197,7 +1204,11 @@ var PartialRibbonsActions = actions.Actions({ // loaded more than we need by threshold... || nl + pl + 1 > size + threshold){ - this.resizeRibbon(target, size) + // XXX this still causes jitter in animation, sometime + // even skipping the whole sequence... + return function(){ + this.resizeRibbon(target, size) + } } }], resizeRibbon: ['Resize ribbon to n images', @@ -1633,7 +1644,7 @@ var CurrentImageIndicatorActions = actions.Actions({ // no marker exists -- create a marker... if(marker.length == 0){ var marker = $('
') - .addClass('current-marker '+ this.tag) + .addClass('current-marker ui-current-image-indicator') .css({ opacity: '0', top: '0px', @@ -1705,7 +1716,7 @@ module.CurrentImageIndicator = Feature({ handlers: [ // move marker to current image... - [ 'focusImage.post', + ['focusImage.post', function(){ this.updateCurrentImageIndicator() }], // prevent animations when focusing ribbons... ['focusRibbon.pre',