]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-16697, two js functions to destroy and show html element"
authordongsheng <dongsheng>
Fri, 11 Sep 2009 02:17:54 +0000 (02:17 +0000)
committerdongsheng <dongsheng>
Fri, 11 Sep 2009 02:17:54 +0000 (02:17 +0000)
lib/javascript-static.js

index 7c8521ca690a57e05f6c3112af12939b9cec7437..7faa09c2a5bc42b1e19fac25c8137dd9ce49162c 100644 (file)
@@ -1094,6 +1094,19 @@ function hide_item(itemid) {
     }
 }
 
+function show_item(itemid) {
+    var item = document.getElementById(itemid);
+    if (item) {
+        item.style.display = "";
+    }
+}
+
+function destroy_item(itemid) {
+    var item = document.getElementById(itemid);
+    if (item) {
+        item.parentNode.removeChild(item);
+    }
+}
 /**
  * Tranfer keyboard focus to the HTML element with the given id, if it exists.
  * @param controlid the control id.