First
diff --git a/bower.json b/bower.json
index cd60799..406ac74 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "reverse-element",
- "version": "0.0.3",
+ "version": "0.0.4",
"description": "Reverses child elements based on property - helpful for accessibility",
"main": "reverse-element.html",
"license": "MIT",
diff --git a/demo/index.html b/demo/index.html
index 40da9c4..1dc6a31 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -22,7 +22,7 @@
-
Basic odd reverse-element demo
+ Toggleable reverse-element demo
@@ -51,13 +51,10 @@
-
Basic even reverse-element demo
+
Reversed reverse-element demo
-
- Toggle Reverse
-
-
+
First
diff --git a/reverse-element.html b/reverse-element.html
index a733aec..7591882 100644
--- a/reverse-element.html
+++ b/reverse-element.html
@@ -33,7 +33,7 @@
},
},
_reverse: function (newVal, oldVal) {
- if (newVal != oldVal && oldVal != undefined) {
+ if ((newVal != oldVal && oldVal != undefined) || (newVal && oldVal==undefined) ) {
// loop from the bottom and remove
for (var i = this.childNodes.length - 1; i >= 0; i--) {
x = this.removeChild(this.childNodes[i]);