]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
QnA - JavaScript to hide close and best buttons when clicked
authorZach Copley <zach@status.net>
Tue, 5 Apr 2011 04:36:42 +0000 (21:36 -0700)
committerZach Copley <zach@status.net>
Tue, 5 Apr 2011 04:36:42 +0000 (21:36 -0700)
plugins/QnA/js/qna.js [new file with mode: 0644]

diff --git a/plugins/QnA/js/qna.js b/plugins/QnA/js/qna.js
new file mode 100644 (file)
index 0000000..82f9a24
--- /dev/null
@@ -0,0 +1,27 @@
+
+var QnA = {
+
+    // hide all the 'close' and 'best' buttons for this question
+
+    // @fixme: Should use ID
+    close: function(closeButt) {
+        $(closeButt)
+            .closest('li.hentry.notice.question')
+            .find('input[name=best],[name=close]')
+            .hide();
+    },
+
+    init: function() {
+        var that = this;
+        $('input[name=close]').live('click', function() {
+            that.close(this);
+        });
+        $('input[name=best]').live('click', function() {
+            that.close(this);
+        });
+    }
+};
+
+$(document).ready(function() {
+    QnA.init();
+});