mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d7d25b6410
commit
e8c2aebf56
39
ui/modes.js
39
ui/modes.js
@ -171,7 +171,7 @@ var toggleSingleImageMode = createCSSClassToggler(
|
||||
var toggleSingleRibbonMode = makeCropModeToggler(
|
||||
'single-ribbon-mode',
|
||||
function(){
|
||||
cropDataTo(DATA.ribbons[getRibbonIndex()].slice())
|
||||
cropDataTo(getRibbonGIDs())
|
||||
})
|
||||
|
||||
|
||||
@ -320,43 +320,6 @@ var toggleInlineImageInfo = createCSSClassToggler(
|
||||
})
|
||||
|
||||
|
||||
function setImageProportions(image, mode){
|
||||
var h = image.outerHeight(true)
|
||||
var w = image.outerWidth(true)
|
||||
mode = mode == null ? toggleImageProportions('?') : 'square'
|
||||
mode = mode == 'fit-viewer' ? 'viewer' : 'squzre'
|
||||
|
||||
if(mode == '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')
|
||||
|
||||
} else {
|
||||
var size = Math.min(w, h)
|
||||
image.css({
|
||||
width: size,
|
||||
height: size
|
||||
})
|
||||
|
||||
// account for rotation...
|
||||
correctImageProportionsForRotation(image)
|
||||
centerView(null, 'css')
|
||||
}
|
||||
|
||||
return image
|
||||
}
|
||||
|
||||
|
||||
// Toggle image container proportions mode
|
||||
//
|
||||
// Available modes:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user