mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-22 07:56:16 +08:00
26 lines
567 B
JavaScript
26 lines
567 B
JavaScript
|
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();
|