From badb5c3cfe7dcce7b6294c75fe72c05cef6d4612 Mon Sep 17 00:00:00 2001 From: Hacktivista Date: Wed, 30 Aug 2017 16:19:59 -0300 Subject: [PATCH] Allow user to set his own defaults --- assets/scripts/src/choices.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/scripts/src/choices.js b/assets/scripts/src/choices.js index 6a9b859..01b3872 100644 --- a/assets/scripts/src/choices.js +++ b/assets/scripts/src/choices.js @@ -128,7 +128,7 @@ class Choices { }; // Merge options with user options - this.config = extend(defaultConfig, userConfig); + this.config = extend(defaultConfig, Choices.userDefaults, userConfig); if (this.config.renderSelectedChoices !== 'auto' && this.config.renderSelectedChoices !== 'always') { if (!this.config.silent) { @@ -2867,4 +2867,6 @@ class Choices { /* ===== End of Private functions ====== */ } +Choices.userDefaults = {}; + module.exports = Choices;