all inpit options are now flat copied...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-10-07 16:16:12 +03:00
parent b2826fe58d
commit 48a87e7724

View File

@ -256,13 +256,13 @@ object.mixinFlat(function(){}, {
// ]) // ])
// //
nest: function(item, list, options){ nest: function(item, list, options){
options = options || {} options = Object.flatCopy(options || {})
//options = Object.assign(Object.create(this.options || {}), options || {}) //options = Object.assign(Object.create(this.options || {}), options || {})
options = Object.assign({}, options = Object.assign({},
{ children: list instanceof Array ? { children: list instanceof Array ?
collectItems(this, list) collectItems(this, list)
: list }, : list },
options) Object.flatCopy(options || {}))
return item === this ? return item === this ?
((this.last().children = options.children), this) ((this.last().children = options.children), this)
: this(item, options) }, : this(item, options) },
@ -554,6 +554,9 @@ var BaseItemPrototype = {
// //
// ...there are likely two issues at play here: // ...there are likely two issues at play here:
// 1) the options related stuff -- non-rendered buttons... // 1) the options related stuff -- non-rendered buttons...
// ...try and rework all the option handling to either
// avoid inheritance (via .flatCopy(..)) or to work it
// into recursion correctly...
// 2) .dom/.elem related stuff -- .update() removes buttons... // 2) .dom/.elem related stuff -- .update() removes buttons...
update: function(options){ update: function(options){
this.parent this.parent
@ -1842,7 +1845,7 @@ var BaseBrowserPrototype = {
var that = this var that = this
options = Object.assign( options = Object.assign(
Object.create(this.options || {}), Object.create(this.options || {}),
options || {}) Object.flatCopy(options || {}))
// sections to make... // sections to make...
var sections = options.section == '*' ? var sections = options.section == '*' ?
@ -1989,7 +1992,7 @@ var BaseBrowserPrototype = {
options ? options ?
Object.assign( Object.assign(
Object.create(that.options || {}), Object.create(that.options || {}),
options || {}) Object.flatCopy(options || {}))
: null) : null)
// if make was not called use the .__items__(..) return value... // if make was not called use the .__items__(..) return value...
@ -2229,7 +2232,7 @@ var BaseBrowserPrototype = {
// options... // options...
options = Object.assign( options = Object.assign(
Object.create(this.options || {}), Object.create(this.options || {}),
options) Object.flatCopy(options))
// options.reverse... // options.reverse...
var reverse = options.reverse === true ? var reverse = options.reverse === true ?
(options.defaultReverse || 'mixed') (options.defaultReverse || 'mixed')
@ -3841,7 +3844,7 @@ var BaseBrowserPrototype = {
// options (optional)... // options (optional)...
this.options = Object.assign( this.options = Object.assign(
Object.create(this.options || {}), Object.create(this.options || {}),
args[0] || {}) }, Object.flatCopy(args[0] || {})) },
} }