1
0
mirror of synced 2025-02-16 20:13:16 +03:00

workaround for IE when manipulating classes. fixes #937 fixes #1017

This commit is contained in:
Igor Vaynberg 2013-03-12 09:27:01 -07:00
parent 89bb328a77
commit ae4b24a7e8

View File

@ -284,7 +284,8 @@ the specific language governing permissions and limitations under the Apache Lic
var classes, replacements = [], adapted;
classes = dest.attr("class");
if (typeof classes === "string") {
if (classes) {
classes = '' + classes; // for IE which returns object
$(classes.split(" ")).each2(function() {
if (this.indexOf("select2-") === 0) {
replacements.push(this);
@ -292,11 +293,12 @@ the specific language governing permissions and limitations under the Apache Lic
});
}
classes = src.attr("class");
if (typeof classes === "string") {
if (classes) {
classes = '' + classes; // for IE which returns object
$(classes.split(" ")).each2(function() {
if (this.indexOf("select2-") !== 0) {
adapted = adapter(this);
if (typeof adapted === "string" && adapted.length > 0) {
if (adapted) {
replacements.push(this);
}
}