Fixed default selections for arrays
This commit is contained in:
parent
e3deb3ae03
commit
d411a0fa76
7
dist/js/select2.amd.full.js
vendored
7
dist/js/select2.amd.full.js
vendored
@ -1137,7 +1137,8 @@ define('select2/data/select',[
|
|||||||
data = {
|
data = {
|
||||||
id: $option.val(),
|
id: $option.val(),
|
||||||
text: $option.html(),
|
text: $option.html(),
|
||||||
disabled: $option.prop('disabled')
|
disabled: $option.prop('disabled'),
|
||||||
|
selected: $option.prop('selected')
|
||||||
};
|
};
|
||||||
} else if ($option.is('optgroup')) {
|
} else if ($option.is('optgroup')) {
|
||||||
data = {
|
data = {
|
||||||
@ -1244,9 +1245,9 @@ define('select2/data/array',[
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var option = this.option(item);
|
var $option = this.option(item);
|
||||||
|
|
||||||
this.$element.append(option);
|
this.$element.append($option);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
7
dist/js/select2.amd.js
vendored
7
dist/js/select2.amd.js
vendored
@ -1137,7 +1137,8 @@ define('select2/data/select',[
|
|||||||
data = {
|
data = {
|
||||||
id: $option.val(),
|
id: $option.val(),
|
||||||
text: $option.html(),
|
text: $option.html(),
|
||||||
disabled: $option.prop('disabled')
|
disabled: $option.prop('disabled'),
|
||||||
|
selected: $option.prop('selected')
|
||||||
};
|
};
|
||||||
} else if ($option.is('optgroup')) {
|
} else if ($option.is('optgroup')) {
|
||||||
data = {
|
data = {
|
||||||
@ -1244,9 +1245,9 @@ define('select2/data/array',[
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var option = this.option(item);
|
var $option = this.option(item);
|
||||||
|
|
||||||
this.$element.append(option);
|
this.$element.append($option);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
7
dist/js/select2.full.js
vendored
7
dist/js/select2.full.js
vendored
@ -10672,7 +10672,8 @@ define('select2/data/select',[
|
|||||||
data = {
|
data = {
|
||||||
id: $option.val(),
|
id: $option.val(),
|
||||||
text: $option.html(),
|
text: $option.html(),
|
||||||
disabled: $option.prop('disabled')
|
disabled: $option.prop('disabled'),
|
||||||
|
selected: $option.prop('selected')
|
||||||
};
|
};
|
||||||
} else if ($option.is('optgroup')) {
|
} else if ($option.is('optgroup')) {
|
||||||
data = {
|
data = {
|
||||||
@ -10779,9 +10780,9 @@ define('select2/data/array',[
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var option = this.option(item);
|
var $option = this.option(item);
|
||||||
|
|
||||||
this.$element.append(option);
|
this.$element.append($option);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
2
dist/js/select2.full.min.js
vendored
2
dist/js/select2.full.min.js
vendored
File diff suppressed because one or more lines are too long
7
dist/js/select2.js
vendored
7
dist/js/select2.js
vendored
@ -1565,7 +1565,8 @@ define('select2/data/select',[
|
|||||||
data = {
|
data = {
|
||||||
id: $option.val(),
|
id: $option.val(),
|
||||||
text: $option.html(),
|
text: $option.html(),
|
||||||
disabled: $option.prop('disabled')
|
disabled: $option.prop('disabled'),
|
||||||
|
selected: $option.prop('selected')
|
||||||
};
|
};
|
||||||
} else if ($option.is('optgroup')) {
|
} else if ($option.is('optgroup')) {
|
||||||
data = {
|
data = {
|
||||||
@ -1672,9 +1673,9 @@ define('select2/data/array',[
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var option = this.option(item);
|
var $option = this.option(item);
|
||||||
|
|
||||||
this.$element.append(option);
|
this.$element.append($option);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
2
dist/js/select2.min.js
vendored
2
dist/js/select2.min.js
vendored
File diff suppressed because one or more lines are too long
@ -473,15 +473,6 @@ $.fn.select2.amd.require(
|
|||||||
|
|
||||||
var data = [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }];
|
var data = [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }];
|
||||||
|
|
||||||
var data = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < 9999; i++) {
|
|
||||||
data.push({
|
|
||||||
id: i.toString(),
|
|
||||||
text: i
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var $ajax = $(".js-example-data-ajax");
|
var $ajax = $(".js-example-data-ajax");
|
||||||
|
|
||||||
var $disabledResults = $(".js-example-disabled-results");
|
var $disabledResults = $(".js-example-disabled-results");
|
||||||
|
4
src/js/select2/data/array.js
vendored
4
src/js/select2/data/array.js
vendored
@ -46,9 +46,9 @@ define([
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var option = this.option(item);
|
var $option = this.option(item);
|
||||||
|
|
||||||
this.$element.append(option);
|
this.$element.append($option);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
3
src/js/select2/data/select.js
vendored
3
src/js/select2/data/select.js
vendored
@ -158,7 +158,8 @@ define([
|
|||||||
data = {
|
data = {
|
||||||
id: $option.val(),
|
id: $option.val(),
|
||||||
text: $option.html(),
|
text: $option.html(),
|
||||||
disabled: $option.prop('disabled')
|
disabled: $option.prop('disabled'),
|
||||||
|
selected: $option.prop('selected')
|
||||||
};
|
};
|
||||||
} else if ($option.is('optgroup')) {
|
} else if ($option.is('optgroup')) {
|
||||||
data = {
|
data = {
|
||||||
|
Loading…
Reference in New Issue
Block a user