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