我想自定义dnd-upload.js文件。例如,我想覆盖_adjustGuiIfFinished
方法。我已多次尝试过这样做,但所有这些都失败了(我正在使用一些教程/示例:
以下是我的步骤:
dnd-upload-ep.js
,内容如下:(function ()
{
Alfresco.EpDNDUpload = function Alfresco_EpDNDUpload(htmlId)
{
Alfresco.EpDNDUpload.superclass.constructor.call(this, htmlId);
return this;
};
YAHOO.extend(Alfresco.EpDNDUpload, Alfresco.DNDUpload,{
_adjustGuiIfFinished: function EpDNDUpload_adjustGuiIfFinished()
{
...
// function body with some modifications
...
})
});
dnd-upload.get.html.ftl
并在js依赖项中包含文件:...
<@markup id="js">
<#-- JavaScript Dependencies -->
<@script type="text/javascript" src="${url.context}/res/components/upload/dnd-upload.js" group="upload"/>
<@script type="text/javascript" src="${url.context}/res/components/upload/dnd-upload-ep.js" group="upload"/>
</@>
...
DNDUpload
实例化最近创建的EpDNDUpload
。要执行此操作,请覆盖dnd-upload.get.js
更改小组实例化元数据&#39;:...
//Widget instantiation metadata...
var dndUpload = {
id : "EpDNDUpload",
name : "Alfresco.EpDNDUpload",
assignTo : "dndUpload"
};
model.widgets = [dndUpload];
...
似乎它应该有效,但它没有。当我上传文档时,我收到Alfresco.EpDNDUpload
未创建但无法实例化的错误。
我做错了吗?