mirror of
https://github.com/documize/community.git
synced 2025-08-08 15:05:28 +02:00
popup blocker detection code
This commit is contained in:
parent
434358088d
commit
d74a56aac1
2 changed files with 18 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue