events: restore "tab-created" usage
This commit is contained in:
parent
a4266e2e76
commit
412866e417
3 changed files with 6 additions and 6 deletions
|
|
@ -42,8 +42,11 @@ var updateDom = function(container,data, remote) {
|
|||
|
||||
// widget
|
||||
var newContainer = parser.parse([data], container[0].abstract.parentNode, container[0].abstract.parent)
|
||||
|
||||
container.replaceWith(newContainer)
|
||||
|
||||
if (data.type == 'tab') newContainer[0].abstract.trigger('tab-created', [{widget: newContainer[0].abstract}])
|
||||
|
||||
$('.editor-root').attr('data-widget', $('.root-container').attr('data-widget'))
|
||||
|
||||
newContainer.trigger('resize')
|
||||
|
|
|
|||
|
|
@ -79,11 +79,10 @@ module.exports = class Panel extends _widgets_base {
|
|||
this.setValue($(e.target).index(), {sync: true, send:this.value != $(e.target).index()})
|
||||
})
|
||||
|
||||
this.on('widget-created', (e)=>{
|
||||
this.on('tab-created', (e)=>{
|
||||
if (e.widget == this) return
|
||||
if (e.widget.parent == this && e.widget.getProp('type') == 'tab') {
|
||||
this.createNavigation()
|
||||
}
|
||||
this.createNavigation()
|
||||
e.stopPropagation = true
|
||||
})
|
||||
|
||||
this.setValue(this.getProp('value') || 0)
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ module.exports = class Tab extends Panel {
|
|||
|
||||
this.detached = false
|
||||
|
||||
var $body = $('body')
|
||||
|
||||
}
|
||||
|
||||
hide() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue