How Can I Enable Use Of Background Elements When The Dialog Is Appeared?
I created a dojo dialog using the example . I work with maps in background. The problem is that when the dialog is appeared, the background is blocked and i can't use the map(the d
Solution 1:
You can do it with a little hack :
require(["dijit/Dialog", "dijit/DialogUnderlay", "dojo/domReady!"], function(Dialog, DialogUnderlay){
//just for the snippets to get the right styling
document.body.className = "tundra";
myDialog = new Dialog({
title: "My Dialog",
content: "Test content.",
style: "width: 300px"
});
myDialog2 = new Dialog({
title: "My Dialog",
content: "Test content.",
style: "width: 300px"
});
showDialog2 = function () {
myDialog2.show().then(function() {
DialogUnderlay.hide()
//little hack to avoid JS error when closing the dialog
DialogUnderlay._singleton.bgIframe = {destroy: function() {}}
});
}
});
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"></script>
<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/resources/dojo.css">
<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dijit/themes/tundra/tundra.css">
<button onclick="myDialog.show();">show with underlay</button>
<button onclick="showDialog2();">show without underlay</button>
Post a Comment for "How Can I Enable Use Of Background Elements When The Dialog Is Appeared?"