mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user