@raona/sp
Version:
Raona utilities to work with Sharepoint using pnp/sp
18 lines (17 loc) • 575 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Function to open a certain url and close it after some time has passed
* @param url url to open on a new window | tab
* @param timeToClose time in milliseconds to wait before closing automatically the window
*/
function openAndCloseWindow(url, timeToClose) {
if (!url)
return;
var win = window.open(url);
setTimeout(function () {
if (win)
win.close();
}, timeToClose || 700);
}
exports.openAndCloseWindow = openAndCloseWindow;