如果你看一下包含在alfresco.js
來源爲Alfresco.util.PopupManager.displayPrompt()
然後你就會看到,該方法創建的YAHOO.widget.SimpleDialog
一個實例,它不支持width屬性。
問題是,displayPrompt()
只會傳遞到SimpleDialog
的特定配置選項,因此如您所見,將其他width
參數添加到您的配置中將不會產生任何影響。
// Create the SimpleDialog that will display the text
var prompt = new YAHOO.widget.SimpleDialog("prompt",
{
close: c.close,
constraintoviewport: c.constraintoviewport,
draggable: c.draggable,
effect: c.effect,
modal: c.modal,
visible: c.visible,
zIndex: this.zIndex++
});
// Show the title if it exists
if (c.title)
{
prompt.setHeader($html(c.title));
}
// Show the prompt text
prompt.setBody(c.noEscape ? c.text : $html(c.text));
// Show the icon if it exists
if (c.icon)
{
prompt.cfg.setProperty("icon", c.icon);
}
// Add the buttons to the dialog
if (c.buttons)
{
prompt.cfg.queueProperty("buttons", c.buttons);
}
// Add the dialog to the dom, center it and show it.
prompt.render(parent);
prompt.center();
prompt.show();
我想提高支持width
財產和其他可能的功能的想法,但在此期間,你是最好的關閉直接在自己的代碼中使用SimpleDialog
,修改上述添加width
參數。
那麼,這基本上是一個正確的答案,雖然不是所需的:) – Zlatko 2013-04-26 13:38:06