mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
added 'loaded' mode to image index status indicator...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
98bff54606
commit
f41d77a022
@ -1482,12 +1482,16 @@ stretching in width... */
|
||||
.overlay-info .index .position.editable {
|
||||
cursor: text;
|
||||
}
|
||||
.overlay-info .index.loaded:after,
|
||||
.overlay-info .index.global:after {
|
||||
content: "G";
|
||||
opacity: 0.7;
|
||||
|
||||
font-size: small;
|
||||
}
|
||||
.overlay-info .index.loaded:after {
|
||||
content: "L";
|
||||
}
|
||||
/*
|
||||
.overlay-info .index.global:hover:after {
|
||||
content: "Global";
|
||||
|
||||
@ -142,6 +142,16 @@ var StatusBarActions = actions.Actions({
|
||||
// make an element...
|
||||
if(typeof(item) == typeof('str')){
|
||||
var type = item
|
||||
var go = function(i){
|
||||
i = i >= 1 ? i-1
|
||||
: i == null ? 'current'
|
||||
: i
|
||||
that.focusImage(i,
|
||||
item.hasClass('global') ?
|
||||
'global'
|
||||
: item.hasClass('loaded') ?
|
||||
'loaded'
|
||||
: undefined) }
|
||||
item = $('<span>')
|
||||
.addClass(type)
|
||||
.append(!(this.config['status-bar-index'] || {})['editable'] ?
|
||||
@ -164,27 +174,15 @@ var StatusBarActions = actions.Actions({
|
||||
})
|
||||
// select image when done...
|
||||
.on('edit-commit', function(_, text){
|
||||
var i = parseInt(text)
|
||||
i = i >= 1 ? i-1
|
||||
: i == null ? 'current'
|
||||
: i
|
||||
that.focusImage(i,
|
||||
item.hasClass('global') ? 'global' : undefined)
|
||||
})
|
||||
go(parseInt(text)) })
|
||||
// update image position...
|
||||
// XXX this appears to be run in the node context...
|
||||
.keyup(function(){
|
||||
// XXX KeyboardEvent does not appear to have this...
|
||||
//event.stopPropagation()
|
||||
|
||||
if((that.config['status-bar-index'] || {})['live-update-on-edit']){
|
||||
var i = parseInt($(this).text())
|
||||
i = i >= 1 ? i-1
|
||||
: i == null ? 'current'
|
||||
: i
|
||||
that.focusImage(i,
|
||||
item.hasClass('global') ? 'global' : undefined)
|
||||
}
|
||||
(that.config['status-bar-index'] || {})['live-update-on-edit']
|
||||
&& go(parseInt($(this).text()))
|
||||
})
|
||||
.focus(function(){
|
||||
$(this).selectText()
|
||||
@ -214,6 +212,11 @@ var StatusBarActions = actions.Actions({
|
||||
var i = this.data ? this.data.getImageOrder(gid) : -1
|
||||
var l = this.data ? this.data.length : 0
|
||||
|
||||
// loaded/crop index...
|
||||
} else if(cls == 'loaded'){
|
||||
var i = this.data ? this.data.getImageOrder('loaded', gid) : -1
|
||||
var l = this.data ? this.data.getImages('loaded').len : 0
|
||||
|
||||
// ribbon index...
|
||||
} else {
|
||||
var i = this.data ? this.data.getImageOrder('ribbon', gid) : -1
|
||||
@ -698,8 +701,9 @@ var StatusBarActions = actions.Actions({
|
||||
}],
|
||||
toggleStatusBarIndexMode: ['Interface/Status bar index mode',
|
||||
toggler.CSSClassToggler(
|
||||
function(){ return this.dom.find('.global-info .index') },
|
||||
['normal', 'global'],
|
||||
function(){
|
||||
return this.dom.find('.global-info .index') },
|
||||
['normal', 'loaded', 'global'],
|
||||
function(state){
|
||||
this.toggleStatusBar('?') == 'none' && this.toggleStatusBar()
|
||||
|
||||
|
||||
@ -898,7 +898,7 @@ var DataPrototype = {
|
||||
: offset > 0 ? 'after'
|
||||
: mode
|
||||
offset = Math.abs(offset)
|
||||
} else if(mode == 'global'){
|
||||
} else if(mode == 'global' || mode == 'loaded'){
|
||||
list = mode
|
||||
mode = 'before'
|
||||
} else if(mode == 'next'){
|
||||
@ -926,6 +926,8 @@ var DataPrototype = {
|
||||
|| this.getRibbon(this.getImage(target, 'after', this.getImages()))]
|
||||
: list == 'global' ?
|
||||
this.order
|
||||
: list == 'loaded' ?
|
||||
this.getImages('loaded')
|
||||
: list instanceof Array ?
|
||||
this.makeSparseImages(list)
|
||||
: this.ribbons[this.getRibbon(list)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user