scinote-web/app/assets/javascripts/sitewide/comments_sidebar.js

26 lines
567 B
JavaScript
Raw Normal View History

2020-11-18 23:26:01 +08:00
var CommentsSidebar = (function() {
const SIDEBAR = '.comments-sidebar';
function initCloseButton() {
$(document).on('click', `${SIDEBAR} .close-btn`, function() {
CommentsSidebar.close();
});
}
return {
init: function() {
initCloseButton();
},
open: function() {
$(SIDEBAR).find('.comments-subject-title').empty();
$(SIDEBAR).find('.comments-list').empty();
$(SIDEBAR).addClass('open loading');
},
close: function() {
$(SIDEBAR).removeClass('open');
}
};
}());
CommentsSidebar.init();