mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 02:40:08 +00:00
Merge branch 'master' of github.com:flynx/ImageGrid
This commit is contained in:
commit
d12a6196cb
@ -1025,6 +1025,15 @@ browse.items.makeSubContext = function(name, obj){
|
|||||||
|
|
||||||
|
|
||||||
// XXX EXPERIMENT...
|
// XXX EXPERIMENT...
|
||||||
|
//
|
||||||
|
// .field(title[, options])
|
||||||
|
// .field(title, value[, options])
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// NOTE: essentially make.field(..) is almost identical to make(..), the
|
||||||
|
// later is needed to provide context for field items and a transparent
|
||||||
|
// fallback for make(..) calls from within their context...
|
||||||
|
//
|
||||||
// XXX Q: should we add an ImageGrid context to make(..)???
|
// XXX Q: should we add an ImageGrid context to make(..)???
|
||||||
// ...something like .app for making it generic-ish for example...
|
// ...something like .app for making it generic-ish for example...
|
||||||
// ....a different approach to this would be to create a list editor
|
// ....a different approach to this would be to create a list editor
|
||||||
@ -1034,14 +1043,16 @@ browse.items.makeSubContext = function(name, obj){
|
|||||||
// ...this can be problematic as the wrapper is external to the browser...
|
// ...this can be problematic as the wrapper is external to the browser...
|
||||||
// - as a sub-path...
|
// - as a sub-path...
|
||||||
// ...this is hard without side-effects...
|
// ...this is hard without side-effects...
|
||||||
// XXX Q: do we actually need .field(..), it does everything make(..)
|
|
||||||
// does already???
|
|
||||||
// XXX Q: should title/value args be optional???
|
|
||||||
// ...and should we break the make(..) convention of passing an arg
|
|
||||||
// array for multiple .text blocks, i.e. make([title, value], ...)??
|
|
||||||
browse.items.makeSubContext('field',
|
browse.items.makeSubContext('field',
|
||||||
function(title, value, options){
|
function(title, value, options){
|
||||||
options = options || {}
|
// parse arguments...
|
||||||
|
var args = [...arguments].slice(1)
|
||||||
|
value = (args[0] instanceof Function
|
||||||
|
|| !(args[0] instanceof Object)) ?
|
||||||
|
args.shift()
|
||||||
|
: undefined
|
||||||
|
options = args.shift() || {}
|
||||||
|
value = value || options.value
|
||||||
Object.assign(
|
Object.assign(
|
||||||
options,
|
options,
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user