Fix firefox popup with content editable.

This commit is contained in:
Florian Mounier
2015-10-08 14:18:35 +02:00
parent 834200256c
commit 0f36db5264
3 changed files with 16 additions and 1 deletions

View File

@@ -167,6 +167,9 @@
Popup.prototype.open = function(html) {
this.el.innerHTML = html;
this.el.classList.remove('hidden');
if (typeof InstallTrigger !== "undefined") {
document.body.contentEditable = 'false';
}
addEventListener('click', this.bound_click_maybe_close);
return addEventListener('keydown', this.bound_key_maybe_close);
};
@@ -174,6 +177,9 @@
Popup.prototype.close = function() {
removeEventListener('click', this.bound_click_maybe_close);
removeEventListener('keydown', this.bound_key_maybe_close);
if (typeof InstallTrigger !== "undefined") {
document.body.contentEditable = 'true';
}
this.el.classList.add('hidden');
return this.el.innerHTML = '';
};

File diff suppressed because one or more lines are too long

View File

@@ -9,12 +9,21 @@ class Popup
@el.innerHTML = html
@el.classList.remove 'hidden'
# ff glorious hack
if typeof InstallTrigger isnt "undefined"
document.body.contentEditable = 'false'
addEventListener 'click', @bound_click_maybe_close
addEventListener 'keydown', @bound_key_maybe_close
close: ->
removeEventListener 'click', @bound_click_maybe_close
removeEventListener 'keydown', @bound_key_maybe_close
# ff glorious hack
if typeof InstallTrigger isnt "undefined"
document.body.contentEditable = 'true'
@el.classList.add 'hidden'
@el.innerHTML = ''