QnA - JavaScript to hide close and best buttons when clicked
This commit is contained in:
parent
84b328450f
commit
338a75e12b
27
plugins/QnA/js/qna.js
Normal file
27
plugins/QnA/js/qna.js
Normal 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();
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user