strip/modal: fix broken props nesting

This commit is contained in:
jean-emmanuel 2017-06-09 14:32:52 +02:00
parent ec7e4f7a09
commit 1448ddc886
2 changed files with 12 additions and 2 deletions

View file

@ -60,7 +60,13 @@ module.exports = class Modal extends _widgets_base {
super({...options, html:html})
this.panel = new Panel({props:{...Panel.defaults(), ...options.props}, container: options.container, parent:options.parent})
var defaults = Panel.defaults()
for (var k in defaults) {
if (!options.props.hasOwnProperty(k))
options.props[k] = defaults[k]
}
this.panel = new Panel(options)
this.panel.widget.appendTo(this.widget.find('.popup-content'))
this.widget.hide()

View file

@ -35,7 +35,11 @@ module.exports = class Strip extends Panel {
constructor(options) {
options.props = {...Panel.defaults(), ...options.props}
var defaults = Panel.defaults()
for (var k in defaults) {
if (!options.props.hasOwnProperty(k))
options.props[k] = defaults[k]
}
super(options)