some minor changes and tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-11-24 04:02:01 +03:00
parent 2fe109a95f
commit 1cfdaaeda1
4 changed files with 40 additions and 29 deletions

View File

@ -407,7 +407,7 @@ module.ImagesPrototype = {
//size = size == null ? getVisibleImageSize('max') : size //size = size == null ? getVisibleImageSize('max') : size
img_data = img_data == null ? this[gid] : img_data 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 if((img_data.preview == null
|| Object.keys(img_data.preview).length == 0) || Object.keys(img_data.preview).length == 0)
&& img_data.path == null){ && img_data.path == null){

View File

@ -47,29 +47,29 @@
} }
.viewer:not(.no-transitions) .ribbon-set:not(.no-transitions) { .viewer:not(.no-transitions) .ribbon-set:not(.no-transitions) {
-webkit-transition: all 0.2s linear, transform 0.2s linear; -webkit-transition: all 0.1s linear, transform 0.1s linear;
-moz-transition: all 0.2s linear, transform 0.2s linear; -moz-transition: all 0.1s linear, transform 0.1s linear;
-ms-transition: all 0.2s linear, transform 0.2s linear; -ms-transition: all 0.1s linear, transform 0.1s linear;
-o-transition: all 0.2s linear, transform 0.2s linear; -o-transition: all 0.1s linear, transform 0.1s linear;
transition: all 0.2s linear, transform 0.2s linear; transition: all 0.1s linear, transform 0.1s linear;
} }
.viewer:not(.no-transitions) .ribbon:not(.no-transitions) { .viewer:not(.no-transitions) .ribbon:not(.no-transitions) {
-webkit-transition: all 0.2s ease-out; -webkit-transition: all 0.1s ease-out;
-moz-transition: all 0.2s ease-out; -moz-transition: all 0.1s ease-out;
-ms-transition: all 0.2s ease-out; -ms-transition: all 0.1s ease-out;
-o-transition: all 0.2s ease-out; -o-transition: all 0.1s ease-out;
transition: all 0.2s ease-out; transition: all 0.1s ease-out;
} }
/* XXX not 100% sure about this... /* XXX not 100% sure about this...
*/ */
.current-marker:not(.no-transitions) { .current-marker:not(.no-transitions) {
-webkit-transition: left 0.2s ease-out; -webkit-transition: left 0.1s ease-out;
-moz-transition: left 0.2s ease-out; -moz-transition: left 0.1s ease-out;
-ms-transition: left 0.2s ease-out; -ms-transition: left 0.1s ease-out;
-o-transition: left 0.2s ease-out; -o-transition: left 0.1s ease-out;
transition: left 0.2s ease-out; transition: left 0.1s ease-out;
} }
/* XXX should this be !important */ /* XXX should this be !important */

View File

@ -568,8 +568,8 @@ module.MetaActions = {
// Mixin a set of local actions into an object... // Mixin a set of local actions into an object...
// //
// XXX test // XXX test
mixinTo: function(to, all, all_attr_types){ mixinTo: function(to, all, descriptors, all_attr_types){
return this.mixin.call(to, this, all, 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 not sure about these...
// XXX test // XXX test
mixout: function(from, all, all_attr_types){ mixout: function(from, all, descriptors, all_attr_types){
// defaults... // defaults...
descriptors = descriptors || true descriptors = descriptors || true
all_attr_types = all_attr_types || false all_attr_types = all_attr_types || false
@ -624,8 +624,8 @@ module.MetaActions = {
// Remove a set of local mixed in actions from object... // Remove a set of local mixed in actions from object...
// //
// XXX test // XXX test
mixoutFrom: function(to, all, all_attr_types){ mixoutFrom: function(to, all, descriptors, all_attr_types){
return this.mixout.call(to, this, all, all_attr_types) return this.mixout.call(to, this, all, descriptors, all_attr_types)
}, },
} }

View File

@ -862,11 +862,15 @@ actions.Actions(Client, {
function(){ function(){
// NOTE: the 0.2 is added to compensate for alignment/scaling // NOTE: the 0.2 is added to compensate for alignment/scaling
// errors -- 2.99 images wide counts as 3 while 2.5 as 2. // 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', nextScreen: ['Focus next image one screen width away',
function(){ 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... // zooming...
@ -1186,10 +1190,13 @@ var PartialRibbonsActions = actions.Actions({
var pa = this.data.getImages(target, size, 'before').length - 1 var pa = this.data.getImages(target, size, 'before').length - 1
// do the update... // do the update...
// loaded more than we need (crop?)...
if(na + pa < nl + pl
// the target is not loaded... // the target is not loaded...
|| this.ribbons.getImage(target).length == 0 if(this.ribbons.getImage(target).length == 0){
this.resizeRibbon(target, size)
// do a late resize...
// loaded more than we need (crop?)...
} else if(na + pa < nl + pl
// passed threshold on the right... // passed threshold on the right...
|| (nl < threshold && na > nl) || (nl < threshold && na > nl)
// passed threshold on the left... // passed threshold on the left...
@ -1197,8 +1204,12 @@ var PartialRibbonsActions = actions.Actions({
// loaded more than we need by threshold... // loaded more than we need by threshold...
|| nl + pl + 1 > size + threshold){ || nl + pl + 1 > size + threshold){
// XXX this still causes jitter in animation, sometime
// even skipping the whole sequence...
return function(){
this.resizeRibbon(target, size) this.resizeRibbon(target, size)
} }
}
}], }],
resizeRibbon: ['Resize ribbon to n images', resizeRibbon: ['Resize ribbon to n images',
function(target, size){ function(target, size){
@ -1633,7 +1644,7 @@ var CurrentImageIndicatorActions = actions.Actions({
// no marker exists -- create a marker... // no marker exists -- create a marker...
if(marker.length == 0){ if(marker.length == 0){
var marker = $('<div/>') var marker = $('<div/>')
.addClass('current-marker '+ this.tag) .addClass('current-marker ui-current-image-indicator')
.css({ .css({
opacity: '0', opacity: '0',
top: '0px', top: '0px',
@ -1705,7 +1716,7 @@ module.CurrentImageIndicator = Feature({
handlers: [ handlers: [
// move marker to current image... // move marker to current image...
[ 'focusImage.post', ['focusImage.post',
function(){ this.updateCurrentImageIndicator() }], function(){ this.updateCurrentImageIndicator() }],
// prevent animations when focusing ribbons... // prevent animations when focusing ribbons...
['focusRibbon.pre', ['focusRibbon.pre',