mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
cleanup + docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
132ba9a220
commit
b7792c4929
@ -51,15 +51,31 @@ var VirtualBlocksActions = actions.Actions({
|
|||||||
//
|
//
|
||||||
// XXX add undo...
|
// XXX add undo...
|
||||||
// XXX do better arg processing -- handle data correctly...
|
// XXX do better arg processing -- handle data correctly...
|
||||||
makeVirtualBlock: ['- $Virtual block/',
|
makeVirtualBlock: ['Virtual block/Add blank $after',
|
||||||
core.doc`
|
core.doc`Add virtual block...
|
||||||
|
|
||||||
|
Add virtual block after current image...
|
||||||
|
.makeVirtualBlock()
|
||||||
|
.makeVirtualBlock('current')
|
||||||
|
.makeVirtualBlock('current', 'after')
|
||||||
|
-> this
|
||||||
|
|
||||||
|
Add virtual block before current image...
|
||||||
|
.makeVirtualBlock('current')
|
||||||
|
.makeVirtualBlock('current', 'after')
|
||||||
|
|
||||||
|
Add virtual block at offset relative to reference image,
|
||||||
|
optionally containing data...
|
||||||
|
.makeVirtualBlock(reference, offset)
|
||||||
.makeVirtualBlock(reference, offset, data)
|
.makeVirtualBlock(reference, offset, data)
|
||||||
-> this
|
-> this
|
||||||
|
|
||||||
.makeVirtualBlock(reference, 'after', data)
|
NOTE: reference if not given defaults to 'current'
|
||||||
.makeVirtualBlock(reference, 'before', data)
|
NOTE: data if not given will default to:
|
||||||
-> this
|
{
|
||||||
|
type: 'virtual',
|
||||||
|
path: null,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Virtual Block Format (Image):
|
Virtual Block Format (Image):
|
||||||
@ -104,7 +120,14 @@ var VirtualBlocksActions = actions.Actions({
|
|||||||
// XXX revise...
|
// XXX revise...
|
||||||
img = arguments[arguments.length-1] instanceof Object ?
|
img = arguments[arguments.length-1] instanceof Object ?
|
||||||
arguments[arguments.length-1]
|
arguments[arguments.length-1]
|
||||||
: null
|
: undefined
|
||||||
|
img = img === null ?
|
||||||
|
img
|
||||||
|
: Object.assign({
|
||||||
|
type: 'virtual',
|
||||||
|
path: null,
|
||||||
|
},
|
||||||
|
img || {})
|
||||||
|
|
||||||
var data = this.data
|
var data = this.data
|
||||||
|
|
||||||
@ -134,23 +157,9 @@ var VirtualBlocksActions = actions.Actions({
|
|||||||
// NOTE: this should update the view too...
|
// NOTE: this should update the view too...
|
||||||
this.focusImage(gid)
|
this.focusImage(gid)
|
||||||
}],
|
}],
|
||||||
|
makeVirtualBlockBefore: ['Virtual block/Add blank $before',
|
||||||
// XXX this is enabled only in collection view as there is no way
|
{ browseMode: 'makeVirtualBlock', },
|
||||||
// to delete a block but possible to create one...
|
'makeVirtualBlock: $0 "before" ...'],
|
||||||
// ...should we add a .removeBlock(..) action???
|
|
||||||
makeVirtualBlank: ['Virtual block/Add blank $after',
|
|
||||||
core.doc`
|
|
||||||
|
|
||||||
`,
|
|
||||||
{ browseMode: 'makeVirtualBlock' },
|
|
||||||
function(ref, offset){
|
|
||||||
this.makeVirtualBlock(ref, offset, {
|
|
||||||
type: 'virtual',
|
|
||||||
path: null,
|
|
||||||
}) }],
|
|
||||||
makeVirtualBlankBefore: ['Virtual block/Add blank $before',
|
|
||||||
{ browseMode: 'makeVirtualBlank', },
|
|
||||||
'makeVirtualBlank: $0 "before"'],
|
|
||||||
|
|
||||||
cloneVirtualBlock: ['Virtual block/$Clone block',
|
cloneVirtualBlock: ['Virtual block/$Clone block',
|
||||||
{ browseMode: function(){
|
{ browseMode: function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user