cleanup and tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-02-09 02:20:31 +03:00
parent c3acf39c0b
commit e03749131c
2 changed files with 20 additions and 7 deletions

View File

@ -141,7 +141,7 @@ requirejs([
}) })
}) })
dialog_1.__root = $('.container').first()[0] dialog_1.parent = $('.container').first()[0]
dialog_1.render() dialog_1.render()

View File

@ -405,7 +405,7 @@ var BaseBrowserPrototype = {
update: function(options){ update: function(options){
return this return this
.make(options) .make(options)
.render(this, options) }, .render(options) },
// XXX item API... // XXX item API...
@ -459,13 +459,26 @@ var BrowserPrototype = {
renderHidden: false, renderHidden: false,
}, },
get parent(){
return this.__parent },
set parent(value){
var dom = this.dom
this.__parent = value
// transfer the dom to the new parent...
dom && (this.dom = dom)
},
get dom(){ get dom(){
return this.__root }, return this.parent ?
this.parent.querySelector('.browse-widget')
: this.__dom },
set dom(value){ set dom(value){
this.__root ? this.parent ?
this.__root.replaceWith(value) $(this.parent).empty().append($(value))
: (this.__root = value)}, : (this.__dom = value) },
// XXX instrument interactions... // XXX instrument interactions...
renderList: function(items, options){ renderList: function(items, options){