1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-08 06:55:28 +02:00

Clean up helpers

This commit is contained in:
zinyando 2016-06-08 15:10:27 +02:00
parent 99e4057fad
commit 05bd894d45
3 changed files with 3 additions and 7 deletions

View file

@ -4,15 +4,15 @@ const userNotification = Ember.Component.extend({
notifications: [], notifications: [],
didInsertElement() { didInsertElement() {
this.eventBus.subscribe('notifyUser', this, 'notifyHandler'); // this.eventBus.subscribe('notifyUser', this, 'notifyHandler');
}, },
willDestroyElement() { willDestroyElement() {
this.eventBus.unsubscribe('notifyUser'); // this.eventBus.unsubscribe('notifyUser');
}, },
showNotification(msg) { showNotification(msg) {
return msg; // return msg;
} }
}); });

View file

@ -6,11 +6,9 @@ function isVisible(selector) {
function checkVisibility(selector, interval, resolve, visibility) { function checkVisibility(selector, interval, resolve, visibility) {
if (isVisible(selector) === visibility) { if (isVisible(selector) === visibility) {
console.log("found in appear");
resolve($(selector)); resolve($(selector));
} else { } else {
Ember.run.later(null, function() { Ember.run.later(null, function() {
console.log("waiting in appear");
checkVisibility(selector, interval, resolve, visibility); checkVisibility(selector, interval, resolve, visibility);
}, interval); }, interval);
} }

View file

@ -6,11 +6,9 @@ function isVisible(selector) {
function checkVisibility(selector, interval, resolve, visibility) { function checkVisibility(selector, interval, resolve, visibility) {
if (isVisible(selector) === visibility) { if (isVisible(selector) === visibility) {
console.log("found");
resolve($(selector)); resolve($(selector));
} else { } else {
Ember.run.later(null, function() { Ember.run.later(null, function() {
console.log("waiting");
checkVisibility(selector, interval, resolve, visibility); checkVisibility(selector, interval, resolve, visibility);
}, interval); }, interval);
} }