2

我无法访问_executeJavaScript 方法中的选择对象。如果我尝试访问它,则会将错误显示为“不支持的函数/对象”。

另一个问题是我的功能区工具栏按钮的图标图像没有得到反映。

4

1 回答 1

3

你是如何定义你的执行功能的?这是可以访问选择的地方:

Sample.Commands.Example.prototype._execute=function Example$_execute(selection) 
{
    if (selection.getCount() == 1) {
        var uriSelection = selection.getItem(0);
        // Do something else
    }
};

对于功能区工具栏按钮图标,请在 CSS 中尝试以下内容:

.tridion .ribbontoolbar .button.Example.text { 
    background-image:
        url(/WebUI/Editors/Sample/Themes/images/icons/example-icon32x32.png);
} 
于 2012-03-02T10:22:20.930 回答