mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
refactoring....
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
f01d8195a9
commit
a3e8872f9f
@ -587,6 +587,14 @@ object.mixinFlat(function(){}, {
|
||||
})
|
||||
|
||||
|
||||
|
||||
// XXX do we need a custom handler here???
|
||||
// XXX do we add defaults to options???
|
||||
var makeFieldWrapper = function(name){
|
||||
return function(title, value, options){
|
||||
return this.__proto__[name]([title, value], options) } }
|
||||
|
||||
|
||||
// Sub-context: .field
|
||||
//
|
||||
// [ title value ... ]
|
||||
@ -621,18 +629,11 @@ Items.makeSubContext('field',
|
||||
: options.value
|
||||
], options) },
|
||||
{
|
||||
// Shorthands...
|
||||
Text: makeFieldWrapper('Text'),
|
||||
// XXX would be nice to force the title to be on a separate line
|
||||
// from the text...
|
||||
Text: function(title, value, options){
|
||||
return this.__proto__.Text([title, value], options) },
|
||||
|
||||
// Editable field value...
|
||||
//
|
||||
// NOTE: this is a shorthand to:
|
||||
// make.Editable([title, value], ..)
|
||||
Editable: function(title, value, options){
|
||||
return this.__proto__.Editable([title, value], options) },
|
||||
|
||||
Editable: makeFieldWrapper('Editable'),
|
||||
|
||||
// Togglable field value...
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user