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

popup blocker detection code

This commit is contained in:
Harvey Kandola 2016-05-20 10:16:11 -07:00
parent 434358088d
commit d74a56aac1
2 changed files with 18 additions and 3 deletions

View file

@ -34,6 +34,10 @@ export default Ember.Component.extend(NotifierMixin, {
});
this.set("sections", sections);
if (this.session.get('popupBlocked')) {
this.showNotification("Hmm, looks like your browser is blocking popups...");
}
},
onCancel() {
@ -55,6 +59,8 @@ export default Ember.Component.extend(NotifierMixin, {
return;
}
this.audit.record('added section' + section.contentType);
this.attrs.onAction(title, contentType);
}
}

View file

@ -183,6 +183,15 @@ export default Ember.Service.extend({
});
}
var blockedPopupTest = window.open("http://d27wjpa4h6c9yx.cloudfront.net/", "directories=no,height=1,width=1,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no");
if (!blockedPopupTest) {
this.set('popupBlocked', true);
} else {
blockedPopupTest.close();
this.set('popupBlocked', false);
}
return new Ember.RSVP.Promise(function(resolve) {
$.ajax({
url: self.get('appMeta').getUrl("public/meta"),