QnA - JavaScript to hide close and best buttons when clicked

This commit is contained in:
Zach Copley 2011-04-04 21:36:42 -07:00
parent 84b328450f
commit 338a75e12b
1 changed files with 27 additions and 0 deletions

27
plugins/QnA/js/qna.js Normal file
View File

@ -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();
});