Merge pull request #8609 from Snuffleupagus/findbar-more-adjustWidth
Ensure that `PDFFindBar._adjustWidth` is called in all situations where the width of the findbar might have changed
This commit is contained in:
commit
d7367f102e
@ -140,10 +140,10 @@ class PDFFindBar {
|
|||||||
this.findField.setAttribute('data-status', status);
|
this.findField.setAttribute('data-status', status);
|
||||||
Promise.resolve(findMsg).then((msg) => {
|
Promise.resolve(findMsg).then((msg) => {
|
||||||
this.findMsg.textContent = msg;
|
this.findMsg.textContent = msg;
|
||||||
|
this._adjustWidth();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.updateResultsCount(matchCount);
|
this.updateResultsCount(matchCount);
|
||||||
this._adjustWidth();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateResultsCount(matchCount) {
|
updateResultsCount(matchCount) {
|
||||||
@ -151,15 +151,18 @@ class PDFFindBar {
|
|||||||
return; // No UI control is provided.
|
return; // No UI control is provided.
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there are no matches, hide the counter.
|
|
||||||
if (!matchCount) {
|
if (!matchCount) {
|
||||||
|
// If there are no matches, hide and reset the counter.
|
||||||
this.findResultsCount.classList.add('hidden');
|
this.findResultsCount.classList.add('hidden');
|
||||||
return;
|
this.findResultsCount.textContent = '';
|
||||||
|
} else {
|
||||||
|
// Update and show the match counter.
|
||||||
|
this.findResultsCount.textContent = matchCount.toLocaleString();
|
||||||
|
this.findResultsCount.classList.remove('hidden');
|
||||||
}
|
}
|
||||||
|
// Since `updateResultsCount` may be called from `PDFFindController`,
|
||||||
// Create and show the match counter.
|
// ensure that the width of the findbar is always updated correctly.
|
||||||
this.findResultsCount.textContent = matchCount.toLocaleString();
|
this._adjustWidth();
|
||||||
this.findResultsCount.classList.remove('hidden');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user