mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 19:00:09 +00:00
...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3c12dedafa
commit
f9941d2edc
@ -31,6 +31,9 @@ var ImageGrid = {
|
|||||||
call[i] = obj[i]
|
call[i] = obj[i]
|
||||||
}
|
}
|
||||||
this[obj.title] = call
|
this[obj.title] = call
|
||||||
|
if(this._type_handler[obj.type] != null){
|
||||||
|
this._type_handler[obj.type](obj)
|
||||||
|
}
|
||||||
return call
|
return call
|
||||||
},
|
},
|
||||||
// define an option...
|
// define an option...
|
||||||
@ -38,14 +41,35 @@ var ImageGrid = {
|
|||||||
this.option[obj.name] = obj.value
|
this.option[obj.name] = obj.value
|
||||||
this.option_props[obj.name] = obj
|
this.option_props[obj.name] = obj
|
||||||
},
|
},
|
||||||
|
_type_handler: {
|
||||||
|
/* XXX also need to make the action change the option...
|
||||||
|
toggle: function(obj){
|
||||||
|
// XXX add an option to store the state...
|
||||||
|
ImageGrid.OPTION({
|
||||||
|
name: obj.title,
|
||||||
|
doc: 'Stores the state of '+obj.title+' action.',
|
||||||
|
value: ImageGrid[obj.title]('?'),
|
||||||
|
callback: function(){
|
||||||
|
ImageGrid[obj.title](ImageGrid.option[obj.title])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
*/
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'set',
|
title: 'set',
|
||||||
doc: 'Set an option\'s value, calling apropriate callbacks.',
|
doc: 'Set an option\'s value, calling apropriate callbacks.',
|
||||||
|
group: 'API',
|
||||||
call: function (obj){
|
call: function (obj){
|
||||||
for(var n in obj){
|
for(var n in obj){
|
||||||
this.option[n] = obj[n]
|
this.option[n] = obj[n]
|
||||||
|
}
|
||||||
|
// NOTE: this seporate so as to remove the posibility of race
|
||||||
|
// conditions...
|
||||||
|
// ...thogh there is still a posibility of conflicting modes
|
||||||
|
for(var n in obj){
|
||||||
// call the callback if it exists...
|
// call the callback if it exists...
|
||||||
if(this.option_props[n].callback != null){
|
if(this.option_props[n].callback != null){
|
||||||
this.option_props[n].callback()
|
this.option_props[n].callback()
|
||||||
@ -56,6 +80,7 @@ ImageGrid.ACTION({
|
|||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'doc',
|
title: 'doc',
|
||||||
doc: 'get documentation for name.',
|
doc: 'get documentation for name.',
|
||||||
|
group: 'API',
|
||||||
call: function(name){
|
call: function(name){
|
||||||
return {
|
return {
|
||||||
action: this[name] != null ? this[name].doc : null,
|
action: this[name] != null ? this[name].doc : null,
|
||||||
|
|||||||
@ -14,8 +14,8 @@ var keybindings = {
|
|||||||
|
|
||||||
|
|
||||||
// zooming...
|
// zooming...
|
||||||
187: function(){scaleContainerBy(ZOOM_FACTOR)}, // +
|
187: function(){scaleContainerBy(ImageGrid.option.ZOOM_FACTOR)}, // +
|
||||||
189: function(){scaleContainerBy(1/ZOOM_FACTOR)}, // -
|
189: function(){scaleContainerBy(1/ImageGrid.option.ZOOM_FACTOR)}, // -
|
||||||
// zoom presets...
|
// zoom presets...
|
||||||
48: {
|
48: {
|
||||||
'default': fitImage, // 0
|
'default': fitImage, // 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user