mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 19:00:09 +00:00
more minor refactoring, starting to prepare for new features...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8ac7b160e6
commit
77c3dc79a3
@ -197,54 +197,47 @@ function handleKeys(event){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// modes...
|
// mode switchers...
|
||||||
function showRibbon(){
|
function unsetViewerMode(mode){
|
||||||
$('.single-image-mode')
|
$('.' + mode)
|
||||||
.removeClass('single-image-mode')
|
.removeClass(mode)
|
||||||
|
// animation...
|
||||||
.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){
|
.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){
|
||||||
$('.current-image').click()
|
$('.current-image').click()
|
||||||
return true
|
return true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function showSingle(){
|
function setViewerMode(mode){
|
||||||
$('.viewer').not('.single-image-mode')
|
$('.viewer').not('.' + mode)
|
||||||
.addClass('single-image-mode')
|
.addClass(mode)
|
||||||
|
// animation...
|
||||||
.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){
|
.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){
|
||||||
$('.current-image').click()
|
$('.current-image').click()
|
||||||
return true
|
return true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ribbon/single view modes...
|
||||||
function toggleRibbonView(){
|
function toggleRibbonView(){
|
||||||
if($('.single-image-mode').length > 0){
|
if($('.single-image-mode').length > 0){
|
||||||
showRibbon()
|
unsetViewerMode('single-image-mode')
|
||||||
} else {
|
} else {
|
||||||
showSingle()
|
setViewerMode('single-image-mode')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// wide view mode toggle...
|
||||||
// XXX replace this with adequate zooming...
|
// XXX replace this with adequate zooming...
|
||||||
// XXX need to reposition the whole thing correctly...
|
// XXX need to reposition the whole thing correctly...
|
||||||
function toggleWideView(){
|
function toggleWideView(){
|
||||||
if($('.wide-view-mode').length > 0){
|
if($('.wide-view-mode').length > 0){
|
||||||
$('.wide-view-mode')
|
unsetViewerMode('wide-view-mode')
|
||||||
.removeClass('wide-view-mode')
|
|
||||||
.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){
|
|
||||||
$('.current-image').click()
|
|
||||||
return true
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
showRibbon()
|
unsetViewerMode('single-image-mode')
|
||||||
//$('.container')
|
setViewerMode('wide-view-mode')
|
||||||
$('.viewer')
|
|
||||||
.not('.wide-view-mode')
|
|
||||||
.addClass('wide-view-mode')
|
|
||||||
.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){
|
|
||||||
$('.current-image').click()
|
|
||||||
return true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,6 +338,8 @@ function shiftImage(direction){
|
|||||||
$('.current-image').click()
|
$('.current-image').click()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function shiftImageDown(){
|
function shiftImageDown(){
|
||||||
return shiftImage('next')
|
return shiftImage('next')
|
||||||
}
|
}
|
||||||
@ -354,4 +349,6 @@ function shiftImageUp(){
|
|||||||
return shiftImage('prev')
|
return shiftImage('prev')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// vim:set ts=4 sw=4 nowrap :
|
// vim:set ts=4 sw=4 nowrap :
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user