mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
still thinking about the general architecture...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
edf96ccb5c
commit
000379b656
@ -133,16 +133,27 @@ var BaseBrowserPrototype = {
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// XXX format doc...
|
// XXX format doc...
|
||||||
|
// XXX should this be a list or a Map/Object????
|
||||||
|
// ...we do not need ultra fast traversal but we do need a way
|
||||||
|
// to identify and select items in a unique way...
|
||||||
|
// XXX how do we handler nested lists???
|
||||||
|
// ...feels like a sub-list should be part of an item, i.e.
|
||||||
|
// create an item and place a list "into" it...
|
||||||
|
// the question is whether this item should be:
|
||||||
|
// - first item of sub-list
|
||||||
|
// - connected to the sub-list but part of the parent list
|
||||||
|
// ...I'm leaning to the later...
|
||||||
items: null,
|
items: null,
|
||||||
|
|
||||||
//
|
//
|
||||||
// .list(make)
|
// .__list__(make)
|
||||||
|
// -> undefined
|
||||||
|
// -> list
|
||||||
//
|
//
|
||||||
// XXX is this the right name???
|
|
||||||
// XXX do we care about the return value???
|
// XXX do we care about the return value???
|
||||||
// XXX not sure how to handle options in here -- see .make(..) and its notes...
|
// XXX not sure how to handle options in here -- see .make(..) and its notes...
|
||||||
list: function(make, options){
|
__list__: function(make, options){
|
||||||
throw new Error('.list(..): Not implemented.') },
|
throw new Error('.__list__(..): Not implemented.') },
|
||||||
|
|
||||||
|
|
||||||
// Make .items...
|
// Make .items...
|
||||||
@ -150,14 +161,13 @@ var BaseBrowserPrototype = {
|
|||||||
// .make()
|
// .make()
|
||||||
// -> this
|
// -> this
|
||||||
//
|
//
|
||||||
// XXX should this reset .items or update them???
|
// XXX revise options handling for .__list__(..)
|
||||||
// ...seems that assigning an ID to an item and recycling would
|
|
||||||
// be nice, not sure yet how to organize this...
|
|
||||||
// XXX revise options handling for .list(..)
|
|
||||||
make: function(options){
|
make: function(options){
|
||||||
var items = this.items = []
|
var items = this.items = []
|
||||||
|
|
||||||
|
var make_called = false
|
||||||
var make = function(value, opts){
|
var make = function(value, opts){
|
||||||
|
make_called = true
|
||||||
items.push(Object.assign(
|
items.push(Object.assign(
|
||||||
{},
|
{},
|
||||||
options || {},
|
options || {},
|
||||||
@ -168,15 +178,20 @@ var BaseBrowserPrototype = {
|
|||||||
make.__proto__ = Items
|
make.__proto__ = Items
|
||||||
make.dialog = this
|
make.dialog = this
|
||||||
|
|
||||||
|
//var res = this.__list__(make)
|
||||||
// XXX not sure about this...
|
// XXX not sure about this...
|
||||||
//this.list(make)
|
var res = this.__list__(make,
|
||||||
this.list(make,
|
|
||||||
options ?
|
options ?
|
||||||
Object.assign(
|
Object.assign(
|
||||||
Object.create(this.options || {}),
|
Object.create(this.options || {}),
|
||||||
options || {})
|
options || {})
|
||||||
: null)
|
: null)
|
||||||
|
|
||||||
|
// if make was not called use the .__list__(..) return value...
|
||||||
|
this.items = make_called ?
|
||||||
|
this.items
|
||||||
|
: res
|
||||||
|
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -269,7 +284,7 @@ var BaseBrowserPrototype = {
|
|||||||
|
|
||||||
|
|
||||||
__init__: function(func, options){
|
__init__: function(func, options){
|
||||||
this.list = func
|
this.__list__ = func
|
||||||
this.options = Object.assign(
|
this.options = Object.assign(
|
||||||
{},
|
{},
|
||||||
this.options || {},
|
this.options || {},
|
||||||
@ -310,6 +325,8 @@ var BrowserPrototype = {
|
|||||||
// XXX maintain header...
|
// XXX maintain header...
|
||||||
return items },
|
return items },
|
||||||
// Render nested list...
|
// Render nested list...
|
||||||
|
// XXX list header
|
||||||
|
// ...is it the responsibility of sub-list or the parent list???
|
||||||
// XXX save link to dom (???)
|
// XXX save link to dom (???)
|
||||||
renderSubList: function(item, rendered, options){
|
renderSubList: function(item, rendered, options){
|
||||||
// XXX expand/collapse state???
|
// XXX expand/collapse state???
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user