some cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-11-25 05:12:01 +04:00
parent 9933b2ded2
commit 0d108eb5f1
3 changed files with 8 additions and 11 deletions

View File

@ -1229,6 +1229,9 @@ function updateImage(image, gid, size){
// flip...
setImageFlipState(image, img_data.flipped == null ? [] : img_data.flipped)
// NOTE: this only has effect on non-square image blocks...
correctImageProportionsForRotation(image)
// marks...
if(MARKED.indexOf(gid) != -1){
image.addClass('marked')
@ -1236,8 +1239,6 @@ function updateImage(image, gid, size){
image.removeClass('marked')
}
correctImageProportionsForRotation(image)
return image
}
@ -1465,9 +1466,6 @@ function loadImagesAround(count, gid, ribbon, data){
$('.viewer').trigger('updatedRibbon', [ribbon_elem])
}
// XXX is this the right place for this?
// XXX this might be too global, do only the images loaded...
//correctImageProportionsForRotation(images)
return images
}
@ -1516,8 +1514,6 @@ function rollImages(n, ribbon, extend, no_compensate_shift){
$('.viewer').trigger('updatedRibbon', [ribbon])
// XXX is this the right place for this?
//correctImageProportionsForRotation(images)
return images
}
@ -1541,7 +1537,6 @@ function reloadViewer(images_per_screen){
// create images...
$('.ribbon').each(function(i, e){
//loadImages(current, Math.min(w * LOAD_SCREENS, DATA.ribbons[i].length), $(this))
loadImagesAround(Math.round(w * LOAD_SCREENS), current, i)
})

View File

@ -837,7 +837,11 @@ function nextRibbon(){
// Compensate for viewer proportioned and rotated images.
//
// NOTE: this is not neede for square image blocks.
// This will set the margins so as to make the rotated image offset the
// same space as it is occupying visually...
//
// NOTE: this is not needed for square image blocks.
// NOTE: if an image block is square, this will remove the margins.
function correctImageProportionsForRotation(images){
var viewer = $('.viewer')
var W = viewer.innerWidth()

View File

@ -99,7 +99,6 @@ function setupDataBindings(viewer){
// likely due to shifting...
|| ( gr.length > l
&& l < Math.round(screen_size * LOAD_SCREENS))){
//loadImages(gid, Math.round(screen_size * LOAD_SCREENS), ribbon)
loadImagesAround(Math.round(screen_size * LOAD_SCREENS), gid, ribbon)
// roll the ribbon while we are advancing...
@ -175,7 +174,6 @@ function setupDataBindings(viewer){
var gid = getImageGID()
$('.ribbon').each(function(){
var r = $(this)
//loadImages(gid, Math.round(screen_size * LOAD_SCREENS), r)
loadImagesAround(Math.round(screen_size * LOAD_SCREENS), gid, r)
})
centerView(null, 'css')