diff --git a/resources/docs/widgets/containers.md b/resources/docs/widgets/containers.md index 7a56ca2e..c1a75033 100644 --- a/resources/docs/widgets/containers.md +++ b/resources/docs/widgets/containers.md @@ -121,6 +121,11 @@ Modals are buttons that turn into a centered popup panels when enabled. They can - default: `100%` - usage: sets the modal's size once opened +### `popupLabel` +- type: `string` +- default: `empty` +- usage: alternative label for the popup + ### `options` - see panel's [`options`](#panel) diff --git a/src/browser/js/app/widgets/containers/modal.js b/src/browser/js/app/widgets/containers/modal.js index 61ea8109..63cb7a33 100644 --- a/src/browser/js/app/widgets/containers/modal.js +++ b/src/browser/js/app/widgets/containers/modal.js @@ -1,5 +1,5 @@ var Panel = require('./panel'), - {icon} = require('../../utils'), + {icon, iconify} = require('../../utils'), doubletabreset = require('../mixins/double_tap_reset') @@ -27,6 +27,7 @@ module.exports = class Modal extends Panel { _modal:'modal', doubleTap: false, + popupLabel:'', popupWidth:'80%', popupHeight:'80%', layout:'', @@ -108,7 +109,8 @@ module.exports = class Modal extends Panel { this.value = v ? 1 : 0 if (!this.init && this.value) { - this.popup.find('.popup-title .popup-label').html(this.container.find('> .label span').html()) + var label = this.getProp('popupLabel') ? iconify(this.getProp('popupLabel')) : this.container.find('> .label span').html() + this.popup.find('.popup-title .popup-label').html(label) this.widget.detach().appendTo(this.popup.find('.popup-content')) }