Ensure admin tab events are handled on page load

The `shown.bs.tab` event was being bound after showTab() was already
called, so on page load, the tabs weren't being updated correctly.
pull/7510/head
Andrew Stone 2021-07-26 18:34:55 -07:00 zatwierdzone przez LB Johnston
rodzic eba4ac1563
commit 7d9e90fdbd
3 zmienionych plików z 12 dodań i 10 usunięć

Wyświetl plik

@ -36,6 +36,7 @@ Changelog
* Fix: Add handling of invalid inline styles submitted to `RichText` so `ConfigException` is not thrown (Alex Tomkins)
* Fix: Ensure comment notifications dropdown handles longer translations without overflowing content (Krzysztof Jeziorny)
* Fix: Set `default_auto_field` in `postgres_search` `AppConfig` (Nick Moreton)
* Fix: Ensure admin tab JS events are handled on page load (Andrew Stone)
2.14.1 (12.08.2021)

Wyświetl plik

@ -295,6 +295,16 @@ $(() => {
$(this).closest('li').removeClass('focused');
});
/* Functions that need to run/rerun when active tabs are changed */
$(document).on('shown.bs.tab', () => {
// Resize autosize textareas
// eslint-disable-next-line func-names
$('textarea[data-autosize-on]').each(function () {
// eslint-disable-next-line no-undef
autosize.update($(this).get());
});
});
/* tabs */
const showTab = (tabButtonElem) => {
$(tabButtonElem).tab('show');
@ -419,16 +429,6 @@ $(() => {
};
}
/* Functions that need to run/rerun when active tabs are changed */
$(document).on('shown.bs.tab', () => {
// Resize autosize textareas
// eslint-disable-next-line func-names
$('textarea[data-autosize-on]').each(function () {
// eslint-disable-next-line no-undef
autosize.update($(this).get());
});
});
/* Debounce submission of long-running forms and add spinner to give sense of activity */
// eslint-disable-next-line func-names
$(document).on('click', 'button.button-longrunning', function () {

Wyświetl plik

@ -51,6 +51,7 @@ Bug fixes
* Add handling of invalid inline styles submitted to ``RichText`` so ``ConfigException`` is not thrown (Alex Tomkins)
* Ensure comment notifications dropdown handles longer translations without overflowing content (Krzysztof Jeziorny)
* Set ``default_auto_field`` in ``postgres_search`` ``AppConfig`` (Nick Moreton)
* Ensure admin tab JS events are handled on page load (Andrew Stone)
Upgrade considerations
======================