Make modules contain their own static files and templates
This commit is contained in:
parent
4a38e896eb
commit
33aa2b851e
20 changed files with 9 additions and 8 deletions
36
realms/modules/wiki/static/js/collaboration/main.js
Normal file
36
realms/modules/wiki/static/js/collaboration/main.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
var $startCollaborationBtn = $('#start-collaboration');
|
||||
var $endCollaborationBtn = $('#end-collaboration');
|
||||
var $loadingCollaborationBtn = $('#loading-collaboration');
|
||||
|
||||
function loadingCollaboration() {
|
||||
$endCollaborationBtn.hide();
|
||||
$startCollaborationBtn.hide();
|
||||
$loadingCollaborationBtn.show();
|
||||
$(document).trigger('loading-collaboration');
|
||||
}
|
||||
|
||||
function startCollaboration() {
|
||||
$loadingCollaborationBtn.hide();
|
||||
$startCollaborationBtn.hide();
|
||||
$endCollaborationBtn.show();
|
||||
$(document).trigger('start-collaboration');
|
||||
}
|
||||
|
||||
function endCollaboration() {
|
||||
$loadingCollaborationBtn.hide();
|
||||
$endCollaborationBtn.hide();
|
||||
$startCollaborationBtn.show();
|
||||
$(document).trigger('end-collaboration');
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$startCollaborationBtn.click(function(e) {
|
||||
loadingCollaboration();
|
||||
e.preventDefault();
|
||||
});
|
||||
$endCollaborationBtn.click(function(e) {
|
||||
endCollaboration();
|
||||
e.preventDefault();
|
||||
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue