mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
fixed a bug with messing up ribbon scale on load...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
68bc67aed1
commit
85de35f4e3
@ -74,7 +74,6 @@ core.ImageGridFeatures.Feature('viewer-testing', [
|
|||||||
'config-local-storage',
|
'config-local-storage',
|
||||||
'ui-url-hash',
|
'ui-url-hash',
|
||||||
'url-history',
|
'url-history',
|
||||||
'ui-single-image-view-local-storage',
|
|
||||||
|
|
||||||
|
|
||||||
'external-editor',
|
'external-editor',
|
||||||
|
|||||||
@ -231,6 +231,9 @@ module.SingleImageView = core.ImageGridFeatures.Feature({
|
|||||||
depends: [
|
depends: [
|
||||||
'ui'
|
'ui'
|
||||||
],
|
],
|
||||||
|
suggested: [
|
||||||
|
'ui-single-image-view-local-storage',
|
||||||
|
],
|
||||||
|
|
||||||
actions: SingleImageActions,
|
actions: SingleImageActions,
|
||||||
|
|
||||||
@ -248,6 +251,13 @@ module.SingleImageView = core.ImageGridFeatures.Feature({
|
|||||||
}],
|
}],
|
||||||
['fitImage.post setScale.post',
|
['fitImage.post setScale.post',
|
||||||
function(){
|
function(){
|
||||||
|
// prevent this from doing anything while no viewer...
|
||||||
|
if(!this.ribbons
|
||||||
|
|| !this.ribbons.viewer
|
||||||
|
|| this.ribbons.getRibbonSet().length == 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// singe image mode -- set image proportions...
|
// singe image mode -- set image proportions...
|
||||||
if(this.toggleSingleImage('?') == 'on'){
|
if(this.toggleSingleImage('?') == 'on'){
|
||||||
updateImageProportions.call(this)
|
updateImageProportions.call(this)
|
||||||
@ -325,19 +335,26 @@ module.SingleImageViewLocalStorage = core.ImageGridFeatures.Feature({
|
|||||||
|
|
||||||
handlers:[
|
handlers:[
|
||||||
// set scale...
|
// set scale...
|
||||||
['load',
|
['load.pre',
|
||||||
function(){
|
function(){
|
||||||
|
// NOTE: at this stage the viewer is not yet ready, and
|
||||||
|
// we need to save these for when it is, thus avoiding
|
||||||
|
// stray actions overwriting the config with defaults
|
||||||
|
// when not finding a value in the viewer...
|
||||||
|
var rscale = this.config['ribbon-scale'] || this.scale
|
||||||
|
var iscale = this.config['single-image-scale'] || this.scale
|
||||||
|
|
||||||
|
return function(){
|
||||||
// prevent this from doing anything while no viewer...
|
// prevent this from doing anything while no viewer...
|
||||||
if(!this.ribbons || !this.ribbons.viewer || this.ribbons.viewer.length == 0){
|
if(!this.ribbons
|
||||||
|
|| !this.ribbons.viewer
|
||||||
|
|| this.ribbons.getRibbonSet().length == 0){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.toggleSingleImage('?') == 'on'){
|
this.scale = this.toggleSingleImage('?') == 'on' ?
|
||||||
this.scale = this.config['single-image-scale'] || this.scale
|
iscale
|
||||||
|
: rscale
|
||||||
} else {
|
|
||||||
// XXX for some reason this stopped working...
|
|
||||||
this.scale = this.config['ribbon-scale'] || this.scale
|
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
@ -425,7 +442,6 @@ module.SingleImageAutoHideCursor = core.ImageGridFeatures.Feature({
|
|||||||
|
|
||||||
core.ImageGridFeatures.Feature('ui-single-image', [
|
core.ImageGridFeatures.Feature('ui-single-image', [
|
||||||
'ui-single-image-view',
|
'ui-single-image-view',
|
||||||
'ui-single-image-view-local-storage',
|
|
||||||
|
|
||||||
'ui-single-image-view-autohide-cursor',
|
'ui-single-image-view-autohide-cursor',
|
||||||
])
|
])
|
||||||
|
|||||||
@ -959,7 +959,7 @@ module.ConfigLocalStorage = core.ImageGridFeatures.Feature({
|
|||||||
}],
|
}],
|
||||||
['stop.pre',
|
['stop.pre',
|
||||||
function(){
|
function(){
|
||||||
this.logger && this.logger.emit('loaded', 'config')
|
this.logger && this.logger.emit('stored', 'config')
|
||||||
this
|
this
|
||||||
.storeConfig()
|
.storeConfig()
|
||||||
.toggleAutoStoreConfig('off')
|
.toggleAutoStoreConfig('off')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user