qf: fix insertNote dialog breakage
Fix breakage in insert note dialog caused by missing icon container after 1eaff81
This commit is contained in:
parent
37a6df4ccb
commit
0f8dce630d
4 changed files with 12 additions and 11 deletions
|
@ -27,5 +27,5 @@ var defaultBubbleizeSelected = Zotero_QuickFormat._bubbleizeSelected;
|
||||||
Zotero_QuickFormat.citingNotes = true;
|
Zotero_QuickFormat.citingNotes = true;
|
||||||
Zotero_QuickFormat._bubbleizeSelected = async function () {
|
Zotero_QuickFormat._bubbleizeSelected = async function () {
|
||||||
await defaultBubbleizeSelected();
|
await defaultBubbleizeSelected();
|
||||||
await Zotero_QuickFormat._accept();
|
await Zotero_QuickFormat.accept();
|
||||||
}
|
}
|
|
@ -53,8 +53,8 @@
|
||||||
<hbox class="citation-dialog main" flex="1" align="start">
|
<hbox class="citation-dialog main" flex="1" align="start">
|
||||||
<hbox flex="1">
|
<hbox flex="1">
|
||||||
<html:div flex="1" spellcheck="false" class="citation-dialog editor insert-note" role="application"></html:div>
|
<html:div flex="1" spellcheck="false" class="citation-dialog editor insert-note" role="application"></html:div>
|
||||||
<vbox class="citation-dialog spinner">
|
<vbox class="citation-dialog icons end">
|
||||||
<image class="zotero-spinner-16"/>
|
<image class="icon zotero-spinner-16"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
</hbox>
|
</hbox>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
|
@ -1188,8 +1188,11 @@ var Zotero_QuickFormat = new function () {
|
||||||
// window boundaries.
|
// window boundaries.
|
||||||
function _resizeEditor() {
|
function _resizeEditor() {
|
||||||
let editorParentWidth = editor.parentNode.getBoundingClientRect().width;
|
let editorParentWidth = editor.parentNode.getBoundingClientRect().width;
|
||||||
let iconWrapperWidth = document.querySelector(".citation-dialog.icons").getBoundingClientRect().width;
|
// Find the widths of all icon containers.
|
||||||
let editorDesiredWidth = editorParentWidth - iconWrapperWidth * 2;
|
// Quick format dialog has 2 sets of icons but insert note dialog has only one
|
||||||
|
let iconWrappers = [...document.querySelectorAll(".citation-dialog.icons")];
|
||||||
|
let iconWrapperWidth = iconWrappers.reduce((totalWidth, iconWrapper) => totalWidth + iconWrapper.getBoundingClientRect().width, 0);
|
||||||
|
let editorDesiredWidth = editorParentWidth - iconWrapperWidth;
|
||||||
// Sanity check: editor width should never be that small
|
// Sanity check: editor width should never be that small
|
||||||
if (editorDesiredWidth > 700) {
|
if (editorDesiredWidth > 700) {
|
||||||
editor.style.width = `${editorDesiredWidth}px`;
|
editor.style.width = `${editorDesiredWidth}px`;
|
||||||
|
@ -1584,7 +1587,9 @@ var Zotero_QuickFormat = new function () {
|
||||||
function _resetSearchTimer() {
|
function _resetSearchTimer() {
|
||||||
// Show spinner
|
// Show spinner
|
||||||
var spinner = document.querySelector('.citation-dialog.icons.end image');
|
var spinner = document.querySelector('.citation-dialog.icons.end image');
|
||||||
spinner.nextElementSibling.style.display = "none";
|
// Accept button does not exist in insertNote dialog
|
||||||
|
let acceptButton = spinner.nextElementSibling;
|
||||||
|
if (acceptButton) acceptButton.style.display = "none";
|
||||||
spinner.setAttribute("status", "animate");
|
spinner.setAttribute("status", "animate");
|
||||||
// Cancel current search if active
|
// Cancel current search if active
|
||||||
if (_searchPromise && _searchPromise.isPending()) {
|
if (_searchPromise && _searchPromise.isPending()) {
|
||||||
|
@ -1596,7 +1601,7 @@ var Zotero_QuickFormat = new function () {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
_searchPromise = null;
|
_searchPromise = null;
|
||||||
spinner.removeAttribute("status");
|
spinner.removeAttribute("status");
|
||||||
spinner.nextElementSibling.style.removeProperty("display");
|
if (acceptButton) acceptButton.style.removeProperty("display");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,10 +192,6 @@
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.citation-dialog.editor.insert-note {
|
|
||||||
width: 750px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.citation-dialog.editor::selection {
|
.citation-dialog.editor::selection {
|
||||||
color: white;
|
color: white;
|
||||||
background: var(--color-accent);
|
background: var(--color-accent);
|
||||||
|
|
Loading…
Reference in a new issue