modal-dialog - 配置 Alfresco.util.PopupManagers YUI 对话框

标签 modal-dialog yui share alfresco

我正在尝试为 Alfresco.util.PopupManager.displayPrompt() 配置宽度,但我不知道该怎么做。

YUI Dialog 有一个 width 属性,但我设法看到的唯一配置,defaultDisplayPromptConfig 对象,似乎并没有太注意我的困惑有了它。

具体来说,我尝试设置 Alfresco.util.PopupManager.defaultDisplayPromptConfig.width 但它不起作用:)

我还尝试对正在加载的面板进行样式设置(create-site 样式注入(inject)面板),但目前不起作用。

有没有办法配置 PopupManager Prompt 对象?

TIA

最佳答案

如果您查看 alfresco.js 中包含的 Alfresco.util.PopupManager.displayPrompt() 源代码然后您将看到该方法创建了一个 YAHOO.widget.SimpleDialog 实例,它确实支持宽度属性。

问题是 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 参数。

关于modal-dialog - 配置 Alfresco.util.PopupManagers YUI 对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16225926/

相关文章:

angular - 在 Typescript/Angular2 中显示 bootbox 警报?

javascript - 使 YUI TreeView 仅使用 +/- 图标展开/折叠

javascript - 如何从 DataSchema XML 迭代数据输出

javascript - 如何在自定义 YUI 单元格编辑器中指定返回值?

java - Android Studio 通过 Intent 共享自定义 View 图像不起作用

swift - 已经添加了 LSApplicationQueriesScheme,但我仍然收到错误 : "This app is not allowed to query for scheme whatsapp"

javascript - 选择链接(内部或外部)时如何关闭模式对话框以及如何设置一个或多个异常(exception)?

c++ - 我的 Qt eventFilter() 没有按预期停止事件

android - 将 html 链接分享到 facebook、twitter 或电子邮件

c# - 当第一个表单已加载时,如何将第二个表单作为对话框打开?