Fix popup preview on Firefox

This commit is contained in:
jdescottes 2015-04-27 22:34:50 +02:00
parent 3f181c6248
commit d3f5a41c0d

View File

@ -21,7 +21,6 @@
ns.PopupPreviewController.prototype.open = function () { ns.PopupPreviewController.prototype.open = function () {
if (!this.isOpen()) { if (!this.isOpen()) {
this.popup = window.open('about:blank', '', 'width=320,height=320'); this.popup = window.open('about:blank', '', 'width=320,height=320');
this.popup.document.body.innerHTML = pskl.utils.Template.get('popup-preview-partial');
window.setTimeout(this.onPopupLoaded.bind(this), 500); window.setTimeout(this.onPopupLoaded.bind(this), 500);
} else { } else {
this.popup.focus(); this.popup.focus();
@ -30,6 +29,7 @@
ns.PopupPreviewController.prototype.onPopupLoaded = function () { ns.PopupPreviewController.prototype.onPopupLoaded = function () {
this.popup.document.title = POPUP_TITLE; this.popup.document.title = POPUP_TITLE;
this.popup.document.body.innerHTML = pskl.utils.Template.get('popup-preview-partial');
pskl.utils.Event.addEventListener(this.popup, 'resize', this.onWindowResize_, this); pskl.utils.Event.addEventListener(this.popup, 'resize', this.onWindowResize_, this);
pskl.utils.Event.addEventListener(this.popup, 'unload', this.onPopupClosed_, this); pskl.utils.Event.addEventListener(this.popup, 'unload', this.onPopupClosed_, this);
var container = this.popup.document.querySelector('.preview-container'); var container = this.popup.document.querySelector('.preview-container');