mirror of
https://github.com/flynx/ImageGrid.git
synced 2026-01-08 11:21:09 +00:00
added basic marking operations (toggle ribbon and toggle block)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a895ed85fe
commit
06219a44cf
@ -138,7 +138,35 @@ Split the API into the following sections:
|
|||||||
|
|
||||||
var toggleImageMark = createCSSClassToggler('.current.image', 'marked')
|
var toggleImageMark = createCSSClassToggler('.current.image', 'marked')
|
||||||
|
|
||||||
|
function invertImageMarks(){
|
||||||
|
return $('.current.image')
|
||||||
|
.closest('.ribbon')
|
||||||
|
.find('.image')
|
||||||
|
.toggleClass('marked')
|
||||||
|
}
|
||||||
|
|
||||||
|
// this will toggle marks in the current continuous section of marked
|
||||||
|
// or unmarked images...
|
||||||
|
function toggleImageMarkBlock(image){
|
||||||
|
if(image == null){
|
||||||
|
image = $('.current.image')
|
||||||
|
}
|
||||||
|
// we need to invert this...
|
||||||
|
var state = toggleImageMark()
|
||||||
|
var _convert = function(){
|
||||||
|
if(toggleImageMark(this, '?') == state){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
toggleImageMark(this, state)
|
||||||
|
}
|
||||||
|
image.nextAll('.image').each(_convert)
|
||||||
|
image.prevAll('.image').each(_convert)
|
||||||
|
return state
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// XXX should we use the createCSSClassToggler for this?
|
||||||
// XXX revise: does extra stuff...
|
// XXX revise: does extra stuff...
|
||||||
function toggleImageProportions(mode){
|
function toggleImageProportions(mode){
|
||||||
var image = $('.image')
|
var image = $('.image')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user