Fix #891
This commit is contained in:
parent
80131f0496
commit
f49a62665a
|
@ -207,17 +207,12 @@ jQuery.fn.selectData = function () {
|
||||||
let selectData = this.select2('data');
|
let selectData = this.select2('data');
|
||||||
|
|
||||||
if (this.prop('multiple')) {
|
if (this.prop('multiple')) {
|
||||||
let results = [];
|
return selectData;
|
||||||
for (const option of selectData) {
|
} else if (selectData.length !== 0 && selectData[0].id) {
|
||||||
results.push(option.element.dataset);
|
return selectData[0];
|
||||||
}
|
|
||||||
|
|
||||||
return results;
|
|
||||||
} else if (selectData.length === 0) {
|
|
||||||
return undefined;
|
|
||||||
} else {
|
|
||||||
return selectData[0].element.dataset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue