mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Fixed lazy load of auth pages
no-issue dumb mistake, cant call then on a function
This commit is contained in:
parent
37266cf552
commit
cd5a9d0c6b
1 changed files with 16 additions and 12 deletions
|
@ -11,18 +11,22 @@ module.exports = function layer2(options) {
|
|||
container
|
||||
});
|
||||
|
||||
var loadAuth = lazyLoadFrame(authUrl, container).then(function (frame) {
|
||||
frame.style.position = 'fixed';
|
||||
frame.style.width = '100%';
|
||||
frame.style.height = '100%';
|
||||
frame.style.background = 'transparent';
|
||||
frame.style.top = '0';
|
||||
frame.style['z-index'] = '9999';
|
||||
return frame;
|
||||
});
|
||||
var loadAuth = lazyLoadFrame(authUrl, container);
|
||||
|
||||
var getAuthFrame = function () {
|
||||
return loadAuth().then(function (frame) {
|
||||
frame.style.position = 'fixed';
|
||||
frame.style.width = '100%';
|
||||
frame.style.height = '100%';
|
||||
frame.style.background = 'transparent';
|
||||
frame.style.top = '0';
|
||||
frame.style['z-index'] = '9999';
|
||||
return frame;
|
||||
});
|
||||
};
|
||||
|
||||
function openAuth(hash, query = '') {
|
||||
return loadAuth().then(function (frame) {
|
||||
return getAuthFrame().then(function (frame) {
|
||||
return new Promise(function (resolve) {
|
||||
frame.src = `${authUrl}#${hash}?${query}`;
|
||||
frame.style.display = 'block';
|
||||
|
@ -78,8 +82,8 @@ function lazyLoadFrame(src, container) {
|
|||
return promise;
|
||||
}
|
||||
promise = loadFrame(src, container);
|
||||
return getFrame();
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
}
|
||||
|
||||
function loadFrame(src, container = document.body) {
|
||||
|
|
Loading…
Add table
Reference in a new issue