added 'loaded' mode to image index status indicator...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-11-16 01:39:29 +03:00
parent 98bff54606
commit f41d77a022
3 changed files with 28 additions and 18 deletions

View File

@ -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";

View File

@ -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()

View File

@ -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)]