mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
added number shortcuts to browser widget...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
7641b95538
commit
4bf8b54ea9
@ -196,6 +196,42 @@
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
/* numbers... */
|
||||
/* XXX need to show this only on devices with keyboards... */
|
||||
.browse .list div:before {
|
||||
opacity: 0.3;
|
||||
float: right;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.browse .list div:nth-of-type(1):before {
|
||||
content: "1";
|
||||
}
|
||||
.browse .list div:nth-of-type(2):before {
|
||||
content: "2";
|
||||
}
|
||||
.browse .list div:nth-of-type(3):before {
|
||||
content: "3";
|
||||
}
|
||||
.browse .list div:nth-of-type(4):before {
|
||||
content: "4";
|
||||
}
|
||||
.browse .list div:nth-of-type(5):before {
|
||||
content: "5";
|
||||
}
|
||||
.browse .list div:nth-of-type(6):before {
|
||||
content: "6";
|
||||
}
|
||||
.browse .list div:nth-of-type(7):before {
|
||||
content: "7";
|
||||
}
|
||||
.browse .list div:nth-of-type(8):before {
|
||||
content: "8";
|
||||
}
|
||||
.browse .list div:nth-of-type(9):before {
|
||||
content: "9";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************** Theaming ***/
|
||||
|
||||
@ -213,6 +213,16 @@ var BrowserPrototype = {
|
||||
A: {
|
||||
ctrl: 'startFullPathEdit!',
|
||||
},
|
||||
|
||||
'#1': 'select: "0!"',
|
||||
'#2': 'select: "1!"',
|
||||
'#3': 'select: "2!"',
|
||||
'#4': 'select: "3!"',
|
||||
'#5': 'select: "4!"',
|
||||
'#6': 'select: "5!"',
|
||||
'#7': 'select: "6!"',
|
||||
'#8': 'select: "7!"',
|
||||
'#9': 'select: "8!"',
|
||||
},
|
||||
},
|
||||
|
||||
@ -889,6 +899,12 @@ var BrowserPrototype = {
|
||||
// .select(<number>)
|
||||
// -> elem
|
||||
//
|
||||
// Select element by absolute sequence number
|
||||
// This is the same as above but will count disabled elements...
|
||||
// NOTE: this will not select unselectable (disabled) elements.
|
||||
// .select('<number>!')
|
||||
// -> elem
|
||||
//
|
||||
// Select element by its text...
|
||||
// NOTE: if text matches one of the reserved commands above use
|
||||
// quotes to escape it...
|
||||
@ -924,16 +940,16 @@ var BrowserPrototype = {
|
||||
// contain '"' or "'"?
|
||||
// ...currently the outer quotes are cleared.
|
||||
select: function(elem, filtering){
|
||||
var pattern = '.list div:not(.disabled):not(.filtered-out)'
|
||||
var browser = this.dom
|
||||
var pattern = '.list div:not(.disabled):not(.filtered-out)'
|
||||
var elems = browser.find(pattern)
|
||||
|
||||
filtering = filtering == null ? this.filtering : filtering
|
||||
|
||||
if(elems.length == 0){
|
||||
return $()
|
||||
}
|
||||
|
||||
filtering = filtering == null ? this.filtering : filtering
|
||||
|
||||
// empty list/string selects none...
|
||||
elem = elem != null && elem.length == 0 ? 'none' : elem
|
||||
// 0 or no args (null) selects first...
|
||||
@ -944,6 +960,17 @@ var BrowserPrototype = {
|
||||
elem = cur.length == 0 ? 'first' : cur
|
||||
}
|
||||
|
||||
// special case: absolute position...
|
||||
if(/\d+!/.test(elem)){
|
||||
elem = this.filter(parseInt(elem), false)
|
||||
|
||||
if(elems.index(elem) < 0){
|
||||
return this.select('none')
|
||||
}
|
||||
|
||||
return this.select(elem)
|
||||
}
|
||||
|
||||
// first/last...
|
||||
if(elem == 'first' || elem == 'last'){
|
||||
return this.select(elems[elem](), filtering)
|
||||
@ -1155,6 +1182,8 @@ var BrowserPrototype = {
|
||||
// NOTE: unlike .list(..) this can be used directly if an item is
|
||||
// selected and an actual open action is defined, either in an
|
||||
// instance or in .options
|
||||
//
|
||||
// XXX should this be select-compatible???
|
||||
open: function(path){
|
||||
var elem = this.select('!')
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user