2013-04-25 39 views
2

我試圖配置寬度Alfresco.util.PopupManager.displayPrompt()但我看不到如何去做。配置Alfresco.util.PopupManagers YUI對話框

YUI對話框有一個寬度財產,但我已經成功地看到的唯一配置,defaultDisplayPromptConfig對象,似乎並沒有太注意我用它搞亂。

具體來說,我嘗試設置Alfresco.util.PopupManager.defaultDisplayPromptConfig.width,但它沒有工作:)

我也試圖風格了我加載面板(創建現場風格注入面板),但它確實現在不工作。

有沒有辦法配置PopupManager提示對象?

TIA

回答

4

如果你看一下包含在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參數。

+0

那麼,這基本上是一個正確的答案,雖然不是所需的:) – Zlatko 2013-04-26 13:38:06