diff --git a/wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.js b/wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.js index aa25214c..37fbe19c 100644 --- a/wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.js +++ b/wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.js @@ -11,7 +11,7 @@ function initInputfieldAsmSelect($select) { options = ProcessWire.config[id]; // deprecated/legacy } else if(typeof ProcessWire.config['InputfieldAsmSelect'] != "undefined") { - options = ProcessWire.config['InputfieldAsmSelect']; + jQuery.extend(options, ProcessWire.config['InputfieldAsmSelect']); } // merge options unique to this instance from select.data-asmopt attribute diff --git a/wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.min.js b/wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.min.js index 697331fe..62e27f36 100644 --- a/wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.min.js +++ b/wire/modules/Inputfield/InputfieldAsmSelect/InputfieldAsmSelect.min.js @@ -1 +1 @@ -function initInputfieldAsmSelect($select){var id=$select.attr("id");var options={};if(typeof ProcessWire.config=="undefined"){options={sortable:true}}else if(typeof ProcessWire.config[id]!="undefined"){options=ProcessWire.config[id]}else if(typeof ProcessWire.config["InputfieldAsmSelect"]!="undefined"){options=ProcessWire.config["InputfieldAsmSelect"]}var data=$select.attr("data-asmopt");if(typeof data!="undefined"){data=JSON.parse(data);if(data){jQuery.extend(options,data);if(typeof ProcessWire.config!="undefined"&&typeof ProcessWire.config[id]=="undefined"){ProcessWire.config[id]=options}}}$select.asmSelect(options)}$(document).ready(function(){$(".InputfieldAsmSelect select[multiple=multiple]").each(function(){initInputfieldAsmSelect($(this))});$(document).on("reloaded",".InputfieldAsmSelect, .InputfieldPage",function(){var $t=$(this);if($t.hasClass("InputfieldPage"))$t=$t.find(".InputfieldAsmSelect");if(!$t.length)return;if($t.find(".asmList").length)return;$(this).find("select[multiple=multiple]").each(function(){initInputfieldAsmSelect($(this))})})}); \ No newline at end of file +function initInputfieldAsmSelect($select){var id=$select.attr("id");var options={};if(typeof ProcessWire.config=="undefined"){options={sortable:true}}else if(typeof ProcessWire.config[id]!="undefined"){options=ProcessWire.config[id]}else if(typeof ProcessWire.config["InputfieldAsmSelect"]!="undefined"){jQuery.extend(options,ProcessWire.config["InputfieldAsmSelect"])}var data=$select.attr("data-asmopt");if(typeof data!="undefined"){data=JSON.parse(data);if(data){jQuery.extend(options,data);if(typeof ProcessWire.config!="undefined"&&typeof ProcessWire.config[id]=="undefined"){ProcessWire.config[id]=options}}}$select.asmSelect(options)}$(document).ready(function(){$(".InputfieldAsmSelect select[multiple=multiple]").each(function(){initInputfieldAsmSelect($(this))});$(document).on("reloaded",".InputfieldAsmSelect, .InputfieldPage",function(){var $t=$(this);if($t.hasClass("InputfieldPage"))$t=$t.find(".InputfieldAsmSelect");if(!$t.length)return;if($t.find(".asmList").length)return;$(this).find("select[multiple=multiple]").each(function(){initInputfieldAsmSelect($(this))})})}); \ No newline at end of file