mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
docs and notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8b014c0e5b
commit
672e309171
@ -1035,35 +1035,55 @@ var EditorActions = actions.Actions({
|
|||||||
// - ...
|
// - ...
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
|
||||||
// Make an editor dialog...
|
|
||||||
// .makeEditor(spec, callback)
|
|
||||||
// -> dialog
|
|
||||||
//
|
|
||||||
// Make an editor dialog section...
|
|
||||||
// .makeEditor(make, spec, callback)
|
|
||||||
// -> make
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// spec format:
|
|
||||||
// [
|
|
||||||
// <text>,
|
|
||||||
//
|
|
||||||
// {
|
|
||||||
// type: <type>,
|
|
||||||
//
|
|
||||||
// id: <str>,
|
|
||||||
// title: <str>,
|
|
||||||
//
|
|
||||||
// value: <str>,
|
|
||||||
//
|
|
||||||
// ...
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
// ...
|
|
||||||
// ]
|
|
||||||
//
|
|
||||||
makeEditor: ['- Interface/',
|
makeEditor: ['- Interface/',
|
||||||
|
core.doc`Make editor dialog or editor section...
|
||||||
|
|
||||||
|
Make an editor dialog...
|
||||||
|
.makeEditor(spec)
|
||||||
|
.makeEditor(spec, callback)
|
||||||
|
-> dialog
|
||||||
|
|
||||||
|
Make an editor dialog section...
|
||||||
|
.makeEditor(make, spec)
|
||||||
|
.makeEditor(make, spec, callback)
|
||||||
|
-> make
|
||||||
|
|
||||||
|
|
||||||
|
spec format:
|
||||||
|
[
|
||||||
|
// make a simple text element...
|
||||||
|
//
|
||||||
|
// same as: make(<text>)
|
||||||
|
<text>,
|
||||||
|
[<text>],
|
||||||
|
|
||||||
|
// call make(..) with args...
|
||||||
|
//
|
||||||
|
// same as: make(...[ .. ])
|
||||||
|
//
|
||||||
|
// NOTE: to explicitly pass an array object to make wrap it
|
||||||
|
// in an array, e.g. [['text', 'value']]
|
||||||
|
[ .. ],
|
||||||
|
|
||||||
|
|
||||||
|
// make a field...
|
||||||
|
{
|
||||||
|
type: <type>,
|
||||||
|
|
||||||
|
id: <str>,
|
||||||
|
title: <str>,
|
||||||
|
|
||||||
|
value: <str>,
|
||||||
|
|
||||||
|
...
|
||||||
|
},
|
||||||
|
|
||||||
|
...
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`,
|
||||||
makeUIDialog(function(spec, callback){
|
makeUIDialog(function(spec, callback){
|
||||||
var _make = function(make, spec){
|
var _make = function(make, spec){
|
||||||
var that = this
|
var that = this
|
||||||
@ -1084,11 +1104,17 @@ var EditorActions = actions.Actions({
|
|||||||
var _callback = callback
|
var _callback = callback
|
||||||
&& function(spec){
|
&& function(spec){
|
||||||
return callback(
|
return callback(
|
||||||
|
// get the field-value pairs...
|
||||||
spec.reduce(function(res, e){
|
spec.reduce(function(res, e){
|
||||||
var id = e.id || e.title
|
var id = e.id || e.title
|
||||||
id != undefined
|
id != undefined
|
||||||
&& (res[id] = e.value)
|
&& (res[id] = e.value)
|
||||||
return res }, {}) ) }
|
return res }, {}),
|
||||||
|
// NOTE: technically we do not need to pass this
|
||||||
|
// through as we are mutating the data inside
|
||||||
|
// but passing it here is cleaner than forcing
|
||||||
|
// the user to get it via closure...
|
||||||
|
spec) }
|
||||||
|
|
||||||
return arguments[0] instanceof Function?
|
return arguments[0] instanceof Function?
|
||||||
// inline...
|
// inline...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user