From 338a75e12b1abd406d42e183d1d9b4eb0053ce5b Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 4 Apr 2011 21:36:42 -0700 Subject: [PATCH] QnA - JavaScript to hide close and best buttons when clicked --- plugins/QnA/js/qna.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 plugins/QnA/js/qna.js diff --git a/plugins/QnA/js/qna.js b/plugins/QnA/js/qna.js new file mode 100644 index 0000000000..82f9a24b1b --- /dev/null +++ b/plugins/QnA/js/qna.js @@ -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(); +}); -- 2.39.5