commit 4d8d4bcdbcfb2c97658c5e2e74c710a909e80260
parent 2538e258b65354024cfb79181ba7edfd15611432
Author: fbennett <biercenator@gmail.com>
Date: Thu, 5 Jan 2017 09:57:37 +0900
Preserve formatting on Hide/Show editor
Diffstat:
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/integration/addCitationDialog.js b/chrome/content/zotero/integration/addCitationDialog.js
@@ -41,6 +41,7 @@ var Zotero_Citation_Dialog = new function () {
var _previewShown = false;
var _suppressNextTreeSelect = false;
var _suppressNextListSelect = false;
+ var _customHTML = false;
var _locatorIndexArray = {};
var _locatorNameArray = {};
var _autoRegeneratePref;
@@ -556,6 +557,9 @@ var Zotero_Citation_Dialog = new function () {
if(_previewShown) {
document.documentElement.getButton("extra2").label = Zotero.getString("citation.hideEditor");
+ if (!text && _customHTML) {
+ text = _customHTML;
+ }
if(text) {
io.preview().then(function(preview) {
_originalHTML = preview;
@@ -565,6 +569,11 @@ var Zotero_Citation_Dialog = new function () {
_updatePreview();
}
} else {
+ if (editor.initialized) {
+ if (editor.value) {
+ _customHTML = editor.value;
+ }
+ }
document.documentElement.getButton("extra2").label = Zotero.getString("citation.showEditor");
}
}
@@ -795,4 +804,4 @@ var Zotero_Citation_Dialog = new function () {
function _clearCitationList() {
while(_citationList.firstChild) _citationList.removeChild(_citationList.firstChild);
}
-}
-\ No newline at end of file
+}