mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-02 20:30:09 +00:00
added keyboard shortcuts to toggle non-traversable and/or disabled elements...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b8ca5619bf
commit
8ead40ded1
@ -183,11 +183,26 @@ var BrowserPrototype = {
|
|||||||
// setting.
|
// setting.
|
||||||
// NOTE: another way to disable traversal is to set
|
// NOTE: another way to disable traversal is to set
|
||||||
// .not-traversable on the .browse-widget element
|
// .not-traversable on the .browse-widget element
|
||||||
|
// NOTE: if false this will also disable .toggleNonTraversableDrawing()
|
||||||
|
// as this will essentially hide/show the whole list.
|
||||||
traversable: true,
|
traversable: true,
|
||||||
|
|
||||||
showNonTraversable: true,
|
showNonTraversable: true,
|
||||||
showDisabled: true,
|
showDisabled: true,
|
||||||
|
|
||||||
|
// enable/disable disabled drawing...
|
||||||
|
//
|
||||||
|
// If false these will disable the corresponding methods.
|
||||||
|
//
|
||||||
|
// NOTE: these are here to let the user enable/disable these
|
||||||
|
// without the need to go into the keyboard configuration...
|
||||||
|
// NOTE: non-traversable drawing is disabled/enabled by .traversable
|
||||||
|
// option above.
|
||||||
|
// NOTE: this will have an effect only on items disabled via list/make
|
||||||
|
// items with .disabled CSS class set manually will not be
|
||||||
|
// affected...
|
||||||
|
toggleDisabledDrawing: true,
|
||||||
|
|
||||||
actionButton: false,
|
actionButton: false,
|
||||||
pushButton: false,
|
pushButton: false,
|
||||||
|
|
||||||
@ -239,6 +254,7 @@ var BrowserPrototype = {
|
|||||||
'A',
|
'A',
|
||||||
'P',
|
'P',
|
||||||
'O',
|
'O',
|
||||||
|
'T', 'D',
|
||||||
|
|
||||||
// let the system handle copy paste...
|
// let the system handle copy paste...
|
||||||
'C', 'V', 'X',
|
'C', 'V', 'X',
|
||||||
@ -267,6 +283,7 @@ var BrowserPrototype = {
|
|||||||
'A',
|
'A',
|
||||||
'P',
|
'P',
|
||||||
'O',
|
'O',
|
||||||
|
'T', 'D',
|
||||||
|
|
||||||
// let the system handle copy paste...
|
// let the system handle copy paste...
|
||||||
'C', 'V', 'X',
|
'C', 'V', 'X',
|
||||||
@ -301,9 +318,6 @@ var BrowserPrototype = {
|
|||||||
Home: 'select!: "first"',
|
Home: 'select!: "first"',
|
||||||
End: 'select!: "last"',
|
End: 'select!: "last"',
|
||||||
|
|
||||||
// XXX add page up and page down...
|
|
||||||
// XXX
|
|
||||||
|
|
||||||
Enter: 'action',
|
Enter: 'action',
|
||||||
O: 'action',
|
O: 'action',
|
||||||
Esc: 'close',
|
Esc: 'close',
|
||||||
@ -314,6 +328,9 @@ var BrowserPrototype = {
|
|||||||
ctrl: 'startFullPathEdit!',
|
ctrl: 'startFullPathEdit!',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
D: 'toggleDisabledDrawing',
|
||||||
|
T: 'toggleNonTraversableDrawing',
|
||||||
|
|
||||||
// XXX should these be select???
|
// XXX should these be select???
|
||||||
// XXX should these be relative to visible area or absolute
|
// XXX should these be relative to visible area or absolute
|
||||||
// to current list regardless of scroll (as is now)???
|
// to current list regardless of scroll (as is now)???
|
||||||
@ -385,18 +402,6 @@ var BrowserPrototype = {
|
|||||||
this.options.traversable = value
|
this.options.traversable = value
|
||||||
},
|
},
|
||||||
|
|
||||||
toogleTraversableDrawing: function(){
|
|
||||||
this.options.showNonTraversable = !this.options.showNonTraversable
|
|
||||||
this.update()
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
toogleDisabledDrawing: function(){
|
|
||||||
this.options.showDisabled = !this.options.showDisabled
|
|
||||||
this.update()
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
// Get/set the listed path...
|
// Get/set the listed path...
|
||||||
//
|
//
|
||||||
// On more info on setting the path see .update(..)
|
// On more info on setting the path see .update(..)
|
||||||
@ -464,6 +469,37 @@ var BrowserPrototype = {
|
|||||||
return this.select(value)
|
return this.select(value)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// NOTE: if .options.traversable is false this will have no effect.
|
||||||
|
// XXX might be a good idea to toggle .non-traversable-hidden CSS
|
||||||
|
// class here too...
|
||||||
|
// ...will need to account for 1-9 shortcut keys and hints to
|
||||||
|
// still work...
|
||||||
|
toggleNonTraversableDrawing: function(){
|
||||||
|
if(this.options.traversable == false){
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
this.options.showNonTraversable = !this.options.showNonTraversable
|
||||||
|
this.update()
|
||||||
|
return this
|
||||||
|
},
|
||||||
|
// XXX this will not affect elements that were disabled via setting
|
||||||
|
// the .disabled class and not via list/make...
|
||||||
|
// ...is this a problem???
|
||||||
|
// XXX might be a good idea to toggle .disabled-hidden CSS class
|
||||||
|
// here too...
|
||||||
|
// ...will need to account for 1-9 shortcut keys and hints to
|
||||||
|
// still work...
|
||||||
|
toggleDisabledDrawing: function(){
|
||||||
|
if(this.options.toggleDisabledDrawing == false){
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
this.options.showDisabled = !this.options.showDisabled
|
||||||
|
this.update()
|
||||||
|
return this
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
// Copy/Paste actions...
|
// Copy/Paste actions...
|
||||||
//
|
//
|
||||||
// XXX use 'Text' for IE...
|
// XXX use 'Text' for IE...
|
||||||
@ -639,8 +675,8 @@ var BrowserPrototype = {
|
|||||||
|
|
||||||
interactive = true
|
interactive = true
|
||||||
|
|
||||||
// do not draw non-traversable elements if .showNonTraversable
|
// skip drawing of non-traversable or disabled elements if
|
||||||
// is false...
|
// .showNonTraversable or .showDisabled are false respectively...
|
||||||
if((!traversable && !that.options.showNonTraversable)
|
if((!traversable && !that.options.showNonTraversable)
|
||||||
|| (disabled && !that.options.showDisabled)){
|
|| (disabled && !that.options.showDisabled)){
|
||||||
return $()
|
return $()
|
||||||
|
|||||||
@ -3313,10 +3313,10 @@ module.FileSystemLoader = ImageGridFeatures.Feature({
|
|||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
var FileSystemLoaderUIActions = actions.Actions({
|
var FileSystemLoaderUIActions = actions.Actions({
|
||||||
// NOTE: this is the same as .browsePath(..) if no argument is given.
|
// NOTE: if no path is passed (null) this behaves just like .browsePath(..)
|
||||||
// the difference is how the first (path/base) argument is handled
|
// otherwise it will just load the given path (no UI) while
|
||||||
// here it's the path to load (now browser shown) and in
|
// .browsePath(..) will load the UI in all cases but will treat
|
||||||
// .browsePath(..) it's the base path to start from.
|
// the given path as a base path to start from.
|
||||||
// XXX should passing no path to this start browsing from the current
|
// XXX should passing no path to this start browsing from the current
|
||||||
// path or from the root?
|
// path or from the root?
|
||||||
loadPath: ['File/Load path...',
|
loadPath: ['File/Load path...',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user