mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
now brows wrap around stops repeat...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
852769acea
commit
0489315a40
@ -1493,6 +1493,8 @@ var BrowserPrototype = {
|
||||
// first make(..) is called, but obviously this should be
|
||||
// as short as possible -- under 20-50ms.
|
||||
holdSize: 20,
|
||||
|
||||
keyboardRepeatPause: 100,
|
||||
},
|
||||
|
||||
// XXX need a way to access buttons...
|
||||
@ -3115,9 +3117,17 @@ var BrowserPrototype = {
|
||||
var all = this.filter('*')
|
||||
//var to = this.select('!', filtering)[action+'All'](pattern).first()
|
||||
var to = all.eq(all.index(this.select('!', filtering)) + (action == 'next' ? 1 : -1))
|
||||
|
||||
// stop keyboard repeat...
|
||||
to.length == 1
|
||||
&& this.options.keyboardRepeatPause > 0
|
||||
&& this.keyboard.pauseRepeat
|
||||
&& this.keyboard.pauseRepeat()
|
||||
|
||||
// range check and overflow...
|
||||
if(to.length == 0){
|
||||
action = action == 'next' ? 'first' : 'last'
|
||||
|
||||
} else {
|
||||
return this.select(to, filtering)
|
||||
}
|
||||
@ -3142,14 +3152,17 @@ var BrowserPrototype = {
|
||||
: $(all.slice(0, all.index(from)).toArray().reverse()))
|
||||
.filter(function(_, e){ return $(e).offset().top != t })
|
||||
|
||||
// stop keyboard repeat...
|
||||
to.length == 1
|
||||
&& this.options.keyboardRepeatPause > 0
|
||||
&& this.keyboard.pauseRepeat
|
||||
&& this.keyboard.pauseRepeat()
|
||||
|
||||
// special case: nothing below -> select wrap | last/first...
|
||||
if(to.length == 0){
|
||||
// select first/last...
|
||||
//return this.navigate(action == 'down' ? 'last' : 'first')
|
||||
|
||||
// XXX stop keyboard repeat...
|
||||
// XXX
|
||||
|
||||
// wrap around....
|
||||
to = this.filter('*').filter(pattern)
|
||||
|
||||
|
||||
@ -62,6 +62,8 @@ var WidgetPrototype = {
|
||||
client: null,
|
||||
|
||||
options: {
|
||||
keyboardRepeatPause: 100,
|
||||
|
||||
nonPropagatedEvents: [
|
||||
'start',
|
||||
|
||||
@ -152,10 +154,11 @@ var WidgetPrototype = {
|
||||
function(){ return that.dom })
|
||||
this.dom
|
||||
.keydown(
|
||||
keyboard.makeKeyboardHandler(
|
||||
keyboard.makePausableKeyboardHandler(
|
||||
this.keyboard,
|
||||
options.logKeys,
|
||||
this))
|
||||
this,
|
||||
function(){ return this.options.keyboardRepeatPause }))
|
||||
}
|
||||
|
||||
if(this.options.nonPropagatedEvents != null){
|
||||
@ -233,10 +236,11 @@ var ContainerPrototype = {
|
||||
function(){ return that.dom })
|
||||
this.dom
|
||||
.keydown(
|
||||
keyboard.makeKeyboardHandler(
|
||||
keyboard.makePausableKeyboardHandler(
|
||||
this.keyboard,
|
||||
options.logKeys,
|
||||
this))
|
||||
this,
|
||||
function(){ return this.options.keyboardRepeatPause }))
|
||||
}
|
||||
|
||||
if(this.options.nonPropagatedEvents != null){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user