summaryrefslogtreecommitdiffstats
path: root/js/jquery.multi-select.js
diff options
context:
space:
mode:
authorlou <louiscuny@gmail.com>2012-12-13 10:52:39 +0100
committerlou <louiscuny@gmail.com>2012-12-13 10:52:39 +0100
commita35cf612fee008ac68ab3f1a707ac4149533adf3 (patch)
tree2c7c5c5a997e0fe0a77f05d6b20a320616b3982f /js/jquery.multi-select.js
parent8bf3927821b08db1660d502abdd196cbc6614fe0 (diff)
downloadmulti-select-a35cf612fee008ac68ab3f1a707ac4149533adf3.zip
multi-select-a35cf612fee008ac68ab3f1a707ac4149533adf3.tar.gz
multi-select-a35cf612fee008ac68ab3f1a707ac4149533adf3.tar.bz2
Check if attribute is a DOM node before copying it. Plugin was not working on IE7.0.9.1
Diffstat (limited to 'js/jquery.multi-select.js')
-rw-r--r--js/jquery.multi-select.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js
index bdfc13b..6eb3da9 100644
--- a/js/jquery.multi-select.js
+++ b/js/jquery.multi-select.js
@@ -1,5 +1,5 @@
/*
-* MultiSelect v0.9
+* MultiSelect v0.9.1
* Copyright (c) 2012 Louis Cuny
*
* This program is free software. It comes without any warranty, to
@@ -72,7 +72,9 @@
for (var cpt = 0; cpt < this.attributes.length; cpt++){
var attr = this.attributes[cpt];
- attributes += attr.name+'="'+attr.value+'" ';
+ if(that.isDomNode(attr.name)){
+ attributes += attr.name+'="'+attr.value+'" ';
+ }
}
var selectableLi = $('<li '+attributes+'><span>'+$(this).text()+'</span></li>'),
selectedLi = selectableLi.clone();
@@ -353,6 +355,14 @@
this.$selectableUl.focusin();
this.$selectionUl.focusout();
ms.trigger('change');
+ },
+ isDomNode: function (attr){
+ return (
+ attr &&
+ typeof attr === "object" &&
+ typeof attr.nodeType === "number" &&
+ typeof attr.nodeName === "string"
+ );
}
}