DEV: Only patch bootbox methods once in tests (#19222)
We were re-patching the deprecated bootbox methods during every app initialization, which would lead to hundreds of deprecation messages being printed for a single invocation.
This commit is contained in:
parent
7a8e018965
commit
7e504a1489
|
@ -3,9 +3,15 @@ import bootbox from "bootbox";
|
|||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
|
||||
let jqueryPluginsConfigured = false;
|
||||
|
||||
export default {
|
||||
name: "jquery-plugins",
|
||||
initialize() {
|
||||
if (jqueryPluginsConfigured) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Settings for bootbox
|
||||
bootbox.animate(false);
|
||||
bootbox.backdrop(true);
|
||||
|
@ -46,5 +52,7 @@ export default {
|
|||
|
||||
// Initialize the autocomplete tool
|
||||
$.fn.autocomplete = autocomplete;
|
||||
|
||||
jqueryPluginsConfigured = true;
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue