mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-06-03 02:49:42 +00:00
Fix firefox popup with content editable.
This commit is contained in:
@@ -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 = '';
|
||||
};
|
||||
|
||||
2
butterfly/static/ext.min.js
vendored
2
butterfly/static/ext.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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 = ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user