mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
several bug fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
fd35af5bfc
commit
282fda76b1
@ -346,6 +346,11 @@ function(item, event, evt, ...args){
|
|||||||
// .event([item, ..], ..)
|
// .event([item, ..], ..)
|
||||||
// -> this
|
// -> this
|
||||||
//
|
//
|
||||||
|
// Trigger event on empty list of items...
|
||||||
|
// .event(null, ..)
|
||||||
|
// .event([], ..)
|
||||||
|
// -> this
|
||||||
|
//
|
||||||
//
|
//
|
||||||
// Handle event action...
|
// Handle event action...
|
||||||
// handler(event_object, items, ...)
|
// handler(event_object, items, ...)
|
||||||
@ -430,9 +435,10 @@ function(event, handler, action, default_item, filter, options){
|
|||||||
// explicit item or query...
|
// explicit item or query...
|
||||||
: item != null ?
|
: item != null ?
|
||||||
filterItems(this[getter](item, options))
|
filterItems(this[getter](item, options))
|
||||||
// item is null or undefined -- get default...
|
// item is undefined -- get default...
|
||||||
: default_item instanceof Function ?
|
: item !== null && default_item instanceof Function ?
|
||||||
[default_item.call(that) || []].flat()
|
[default_item.call(that) || []].flat()
|
||||||
|
// item is null (explicitly) or other...
|
||||||
: [],
|
: [],
|
||||||
...args) },
|
...args) },
|
||||||
// get base method attributes -- keep the event method format...
|
// get base method attributes -- keep the event method format...
|
||||||
@ -499,10 +505,12 @@ function(get_state, set_state, unset_state, default_item, multi, options){
|
|||||||
state = item in states ?
|
state = item in states ?
|
||||||
item
|
item
|
||||||
: state
|
: state
|
||||||
item = (state === item ?
|
item = state === item ?
|
||||||
null
|
undefined
|
||||||
: item)
|
: item
|
||||||
|| _default_item.call(this)
|
item = item === undefined ?
|
||||||
|
_default_item.call(this)
|
||||||
|
: item
|
||||||
state = state in states ?
|
state = state in states ?
|
||||||
states[state]
|
states[state]
|
||||||
: 'next'
|
: 'next'
|
||||||
@ -2547,8 +2555,6 @@ var BaseBrowserPrototype = {
|
|||||||
// NOTE: this will ignore disabled items.
|
// NOTE: this will ignore disabled items.
|
||||||
// NOTE: .focus('next') / .focus('prev') will not wrap around the
|
// NOTE: .focus('next') / .focus('prev') will not wrap around the
|
||||||
// first last elements...
|
// first last elements...
|
||||||
//
|
|
||||||
// XXX BUG: .focused = null for some reason selects the first element...
|
|
||||||
focus: makeItemEventMethod('focus',
|
focus: makeItemEventMethod('focus',
|
||||||
function(evt, items){
|
function(evt, items){
|
||||||
// blur .focused...
|
// blur .focused...
|
||||||
@ -2584,8 +2590,6 @@ var BaseBrowserPrototype = {
|
|||||||
function(){ return this.focused || 0 },
|
function(){ return this.focused || 0 },
|
||||||
false),
|
false),
|
||||||
|
|
||||||
// XXX BUG: .selected = null for some reason adds .focused to selection...
|
|
||||||
// ...smake problem with .focus(..) / .focused ...
|
|
||||||
select: makeItemEventMethod('select',
|
select: makeItemEventMethod('select',
|
||||||
function(evt, items){
|
function(evt, items){
|
||||||
items.forEach(function(item){
|
items.forEach(function(item){
|
||||||
@ -2655,6 +2659,11 @@ var BaseBrowserPrototype = {
|
|||||||
&& this.update() },
|
&& this.update() },
|
||||||
null,
|
null,
|
||||||
{ skipDisabled: false }),
|
{ skipDisabled: false }),
|
||||||
|
toggleDisabled: makeItemEventToggler(
|
||||||
|
'disabled',
|
||||||
|
'disable', 'enable',
|
||||||
|
'focused',
|
||||||
|
{ skipDisabled: false }),
|
||||||
|
|
||||||
// primary/secondary/ternary? item actions...
|
// primary/secondary/ternary? item actions...
|
||||||
// XXX revise default actions...
|
// XXX revise default actions...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user