mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-02 20:30:09 +00:00
cleanup and bookkeeping...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e7b810ac06
commit
c38bb8dd50
15
ui/TODO.otl
15
ui/TODO.otl
@ -123,8 +123,21 @@ Roadmap
|
|||||||
| are called in right sequence...
|
| are called in right sequence...
|
||||||
[_] BUG: jumping screen images does not load the adjacent ribbons...
|
[_] BUG: jumping screen images does not load the adjacent ribbons...
|
||||||
| positioning is OK but ribbons are not fully visible...
|
| positioning is OK but ribbons are not fully visible...
|
||||||
[_] BUG: changing window size in single image modes messes things up...
|
[_] BUG: changing window size (F11) in single image modes messes things up...
|
||||||
|
| some images are of different sizes (newly loaded) and aligned in a wrong way...
|
||||||
|
|
|
||||||
|
| appears not to affect square-fit view...
|
||||||
|
|
|
||||||
| until we cycle to ribbon mode and back...
|
| until we cycle to ribbon mode and back...
|
||||||
|
|
|
||||||
|
| Q: does this trigger the on-resize event???
|
||||||
|
| A: no, not connected...
|
||||||
|
|
|
||||||
|
| possible that this is connected with the align/load bug...
|
||||||
|
|
|
||||||
|
| appears to be a state leak, this affects:
|
||||||
|
| - correctImageProportionsForRotation(image) -- mis-alignes images
|
||||||
|
| while after cycling single image mode, behaves correctly...
|
||||||
[_] ASAP: test on Android...
|
[_] ASAP: test on Android...
|
||||||
[_] 0% Tablet UI
|
[_] 0% Tablet UI
|
||||||
[_] screen buttons
|
[_] screen buttons
|
||||||
|
|||||||
@ -951,6 +951,7 @@ function correctImageProportionsForRotation(images){
|
|||||||
var w = image.outerWidth()
|
var w = image.outerWidth()
|
||||||
var h = image.outerHeight()
|
var h = image.outerHeight()
|
||||||
|
|
||||||
|
// non-square image...
|
||||||
if(w != h){
|
if(w != h){
|
||||||
var proportions = W/H - w/h
|
var proportions = W/H - w/h
|
||||||
|
|
||||||
@ -977,6 +978,7 @@ function correctImageProportionsForRotation(images){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// square image...
|
||||||
} else {
|
} else {
|
||||||
image.css({
|
image.css({
|
||||||
'margin': '',
|
'margin': '',
|
||||||
|
|||||||
@ -54,6 +54,8 @@ $(function(){
|
|||||||
.resize(function() {
|
.resize(function() {
|
||||||
// XXX should this be animated or not?
|
// XXX should this be animated or not?
|
||||||
centerView()
|
centerView()
|
||||||
|
|
||||||
|
// XXX problems in single image mode after hitting F11...
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
|
|||||||
46
ui/modes.js
46
ui/modes.js
@ -153,7 +153,7 @@ var toggleSingleImageMode = createCSSClassToggler('.viewer',
|
|||||||
w = SETTINGS['screen-images-ribbon-mode']
|
w = SETTINGS['screen-images-ribbon-mode']
|
||||||
w = w == null ? DEFAULT_SCREEN_IMAGES : w
|
w = w == null ? DEFAULT_SCREEN_IMAGES : w
|
||||||
|
|
||||||
toggleImageProportions('square')
|
toggleImageProportions('fit-square')
|
||||||
fitNImages(w)
|
fitNImages(w)
|
||||||
var i = SETTINGS['image-info-ribbon-mode'] == 'on' ? 'on' : 'off'
|
var i = SETTINGS['image-info-ribbon-mode'] == 'on' ? 'on' : 'off'
|
||||||
toggleImageInfo(i)
|
toggleImageInfo(i)
|
||||||
@ -256,6 +256,7 @@ var toggleInlineImageInfo = createCSSClassToggler('.viewer',
|
|||||||
// al least at this point...
|
// al least at this point...
|
||||||
// XXX should we use the createCSSClassToggler for this?
|
// XXX should we use the createCSSClassToggler for this?
|
||||||
// XXX revise: does extra stuff...
|
// XXX revise: does extra stuff...
|
||||||
|
/*
|
||||||
function toggleImageProportions(mode){
|
function toggleImageProportions(mode){
|
||||||
// normal images...
|
// normal images...
|
||||||
var image = $('.image')
|
var image = $('.image')
|
||||||
@ -298,8 +299,49 @@ function toggleImageProportions(mode){
|
|||||||
centerView(null, 'css')
|
centerView(null, 'css')
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'mode'
|
return mode
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
var toggleImageProportions = createCSSClassToggler('.viewer',
|
||||||
|
[
|
||||||
|
'fit-square',
|
||||||
|
'fit-viewer'
|
||||||
|
],
|
||||||
|
function(action){
|
||||||
|
var image = $('.image')
|
||||||
|
var h = image.outerHeight(true)
|
||||||
|
var w = image.outerWidth(true)
|
||||||
|
|
||||||
|
// viewer proportions...
|
||||||
|
if(action == 'fit-image-to-viewer'){
|
||||||
|
var viewer = $('.viewer')
|
||||||
|
var W = viewer.innerWidth()
|
||||||
|
var H = viewer.innerHeight()
|
||||||
|
|
||||||
|
if(W > H){
|
||||||
|
image.css('width', W * h/H)
|
||||||
|
} else {
|
||||||
|
image.css('height', H * w/W)
|
||||||
|
}
|
||||||
|
|
||||||
|
// account for rotation...
|
||||||
|
correctImageProportionsForRotation(image)
|
||||||
|
centerView(null, 'css')
|
||||||
|
|
||||||
|
// square proportions...
|
||||||
|
} else {
|
||||||
|
var size = Math.min(w, h)
|
||||||
|
image.css({
|
||||||
|
width: size,
|
||||||
|
height: size
|
||||||
|
})
|
||||||
|
|
||||||
|
// account for rotation...
|
||||||
|
correctImageProportionsForRotation(image)
|
||||||
|
centerView(null, 'css')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
var toggleHelp = makeDrawerToggler(
|
var toggleHelp = makeDrawerToggler(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user