-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoe-studio-utils.js
37 lines (34 loc) · 1.09 KB
/
oe-studio-utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* @license
* ©2018-2019 EdgeVerve Systems Limited (a fully owned Infosys subsidiary),
* Bangalore, India. All Rights Reserved.
*/
window.OEUtils = window.OEUtils || {};
window.OEUtils._getRestApiUrl = function(path){
var restApiRoot = (window.OEUtils && window.OEUtils.restApiRoot) ? window.OEUtils.restApiRoot : '/api';
return restApiRoot + path;
};
//Fix for nested dialog box with modal property
window.addEventListener('iron-overlay-opened',function(e){
//handle backdrop;
var dialog = e.target;
if(dialog.tagName.toLowerCase() !== 'paper-dialog'){
return;
}
var parentEle = dialog.parentNode;
var overlay = document.querySelector('iron-overlay-backdrop');
if(overlay){
parentEle.insertBefore(overlay,dialog);
}
});
window.addEventListener('iron-overlay-closed',function(e){
//handle backdrop
var dialog = e.target;
if(dialog.tagName.toLowerCase() !== 'paper-dialog'){
return;
}
var overlay = document.querySelector('iron-overlay-backdrop');
if(overlay){
overlay.parentNode.removeChild(overlay);
}
});