Merge pull request #1563 from UltCombo/1562
Fixes #1562 do not trigger change on $().select2('data') unless specified with the second param
This commit is contained in:
commit
2ab64be416
10
select2.js
10
select2.js
@ -2294,15 +2294,19 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
},
|
||||
|
||||
// single
|
||||
data: function(value, triggerChange) {
|
||||
var data;
|
||||
data: function(value) {
|
||||
var data,
|
||||
triggerChange = false;
|
||||
|
||||
if (arguments.length === 0) {
|
||||
data = this.selection.data("select2-data");
|
||||
if (data == undefined) data = null;
|
||||
return data;
|
||||
} else {
|
||||
if (!value || value === "") {
|
||||
if (arguments.length > 1) {
|
||||
triggerChange = arguments[1];
|
||||
}
|
||||
if (!value) {
|
||||
this.clear(triggerChange);
|
||||
} else {
|
||||
data = this.data();
|
||||
|
Loading…
Reference in New Issue
Block a user