【发布时间】:2021-02-17 07:47:30
【问题描述】:
我正在开发 Notes 10。我有一个 csjs 函数,当一个事件的完整更新运行时,它会调用一个 dojo 进度条。
当我使用默认主题时,它工作得很好。但是,当我将主题更改为 Bootstrap3 时,进度条仍然显示,但它显示在引导模式背景的后面。我已尝试将 .modal-backdrop 的样式更改为 display:none 或 background-color: transparent 但什么也没拿。
代码如下
Xpage
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.resources>
<xp:script src="/xProgress.js" clientSide="true"></xp:script>
<xp:dojoModule name="dijit.Dialog"></xp:dojoModule>
<xp:dojoModule name="dijit.ProgressBar"></xp:dojoModule>
</xp:this.resources>
<xp:button value="Test Progress Bar" id="button1">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete" onComplete="progressDlg.hide();">
<xp:this.action><![CDATA[#{javascript:for(i = 0; i < 100; i++)
{
print("TEST");
}}]]></xp:this.action>
<xp:this.script><![CDATA[ var progressBar = new dijit.ProgressBar({indeterminate:true, layoutAlign: "left"});
progressDlg = new dijit.Dialog( {
title:"Please wait... "+"\n" +"Fetching Information.",
content: progressBar,
style: "width: 300px",
closable: false //Take this out to show close button
});
progressDlg.show();]]></xp:this.script>
</xp:eventHandler></xp:button>
</xp:view>
xProgress.js
dojo.require("dijit.ProgressBar");
var xProgress= {
updateInterval : 750, //update interval in ms
progressXAgentPath : window.location.href.substring(0, window.location.href.indexOf(".nsf")+4) + "/getProgress.xsp",
timerId : null,
targetNode : null,
targetNodeId : null,
progressBar : null,
start : function() {
this.targetNode = dojo.byId(this.targetNodeId);
if (this.targetNode==0) {
alert("Invalid target node specified for xProgress progress bar");
}
//setup the dijit progressbar
if (this.progressBar == null) {
this.progressBar = new dijit.ProgressBar({id: "myProgressBar", maximum: 100}, this.targetNode);
} else {
this.progressBar.update({
maximum: 100,
progress: 0
});
}
this.timerId = setInterval( dojo.hitch(xProgress, "update"), this.updateInterval);
},
stop : function() {
if (this.timerId != null) {
clearInterval(this.timerId);
this.timerId = null;
}
this.progressBar.update({
progress: 100
});
},
update : function() {
dojo.xhrGet({
url: this.progressXAgentPath,
handleAs: "json",
load: dojo.hitch(xProgress, "dataLoadSuccess"),
error: dojo.hitch(xProgress, "dataLoadError")
});
},
dataLoadSuccess : function(data) {
this.progressBar.update({
progress: data.progress
});
},
dataLoadError : function(error) {
this.targetNode.innerHTML = "An unexpected error occurred: " + error;
}
}
function updateProgress(to) {
progressPercentage = to;
sessionScope.put("progress", to);
}
【问题讨论】:
-
也许改变元素的 z-index 使其高于模态背景。
-
@FredrikNorling 我尝试更改 z-index 但它没有出现在背景前面。
-
任何我们可以检查的公开网站或显示我可以下载和检查的问题的简单 .nsf 数据库。
-
很遗憾没有。整个笔记系统托管在我们的服务器上,不允许公共访问。但是,如果您在任何 notes 10 .nsf 数据库中复制我上面的代码,您将能够复制该问题。
标签: javascript twitter-bootstrap-3 dojo bootstrap-modal xpages