mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 11:14:12 +02:00
Fix issue processwire/processwire-issues#999
This commit is contained in:
@@ -18,7 +18,13 @@ function initInputfieldAsmSelect($select) {
|
|||||||
var data = $select.attr('data-asmopt');
|
var data = $select.attr('data-asmopt');
|
||||||
if(typeof data != "undefined") {
|
if(typeof data != "undefined") {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if(data) jQuery.extend(options, data);
|
if(data) {
|
||||||
|
jQuery.extend(options, data);
|
||||||
|
if(typeof ProcessWire.config != "undefined" && typeof ProcessWire.config[id] == "undefined") {
|
||||||
|
// for classes like Repeater/Matrix that may be looking for this in ProcessWire.config
|
||||||
|
ProcessWire.config[id] = options;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$select.asmSelect(options);
|
$select.asmSelect(options);
|
||||||
|
@@ -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)}$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))})})});
|
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))})})});
|
Reference in New Issue
Block a user