Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
waiter: task(function * () {
let event = yield waitForEvent(document.body, 'click');
return event;
}),
// END-SNIPPET
emberEventedLoop: task(function * () {
while(true) {
let event = yield waitForEvent(this, 'fooEvent');
this.set('emberEvent', event);
}
}).on('didInsertElement'),
// END-SNIPPET
prepareForOIDC: task(function*(oidcWindow) {
// show the loading animation in the parent
this.onLoading(true);
// start watching the popup window and the current one
this.watchPopup.perform(oidcWindow);
this.watchCurrent.perform(oidcWindow);
// and then wait for storage event to be fired from the popup
// window setting a value in localStorage when the callback route is loaded
let storageEvent = yield waitForEvent(this.getWindow(), 'storage');
this.exchangeOIDC.perform(storageEvent, oidcWindow);
}),
jQueryEventLoop: task(function * () {
let $body = $('body');
while(true) {
let event = yield waitForEvent($body, 'click');
this.set('jQueryEvent', event);
}
}).on('didInsertElement'),
@task(function*() {
while (true) {
let ev = yield waitForEvent(document.body, 'click');
if (!this.element.contains(ev.target) && !this.awaitingConfirmation) {
this.send('setToIdle');
}
}
})
cancelOnClickOutside;
waitForResize: task(function*() {
while (true) {
yield waitForEvent(window, 'resize');
run.scheduleOnce('afterRender', this, 'updateDimensions');
}
})
.on('didInsertElement')
waitForKeyUp: task(function*() {
while (true) {
let event = yield waitForEvent(document.body, 'keyup');
this.onEscape(event);
}
})
.on('didInsertElement')
waitForResize: task(function*() {
while (true) {
yield waitForEvent(window, 'resize');
run.scheduleOnce('afterRender', this, 'updateDimensions');
}
})
.on('didInsertElement')
watchCurrent: task(function*(oidcWindow) {
yield waitForEvent(this.getWindow(), 'beforeunload');
oidcWindow.close();
}),
cancelOnClickOutside: task(function*() {
while (true) {
let ev = yield waitForEvent(document.body, 'click');
if (!this.element.contains(ev.target) && !this.awaitingConfirmation) {
this.send('setToIdle');
}
}
}),