mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-09 05:18:01 +08:00
Fix constant initialization
This commit is contained in:
parent
818a4dfdb3
commit
c9de9e857f
1 changed files with 391 additions and 390 deletions
|
@ -1,9 +1,9 @@
|
|||
/* global I18n dropdownSelector HelperModule animateSpinner */
|
||||
/* eslint-disable no-use-before-define */
|
||||
(function() {
|
||||
const STATUS_POLLING_INTERVAL = 5000;
|
||||
|
||||
const STATUS_POLLING_INTERVAL = 5000;
|
||||
|
||||
function initTaskCollapseState() {
|
||||
function initTaskCollapseState() {
|
||||
let taskView = '.my-modules-protocols-index';
|
||||
let taskSection = '.task-section-caret';
|
||||
let taskId = $(taskView).data('task-id');
|
||||
|
@ -35,9 +35,9 @@ function initTaskCollapseState() {
|
|||
|
||||
collapseStateSave();
|
||||
collapseStateLoad();
|
||||
}
|
||||
}
|
||||
|
||||
function updateStartDate() {
|
||||
function updateStartDate() {
|
||||
let updateUrl = $('#startDateContainer').data('update-url');
|
||||
let val = $('#calendarStartDate').val();
|
||||
$.ajax({
|
||||
|
@ -54,16 +54,16 @@ function updateStartDate() {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Bind ajax for editing due dates
|
||||
function initStartDatePicker() {
|
||||
// Bind ajax for editing due dates
|
||||
function initStartDatePicker() {
|
||||
$('#calendarStartDate').on('dp.change', function() {
|
||||
updateStartDate();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updateDueDate() {
|
||||
function updateDueDate() {
|
||||
let updateUrl = $('#dueDateContainer').data('update-url');
|
||||
let val = $('#calendarDueDate').val();
|
||||
$.ajax({
|
||||
|
@ -80,18 +80,18 @@ function updateDueDate() {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Bind ajax for editing due dates
|
||||
function initDueDatePicker() {
|
||||
// Bind ajax for editing due dates
|
||||
function initDueDatePicker() {
|
||||
$('#calendarDueDate').on('dp.change', function() {
|
||||
updateDueDate();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Bind ajax for editing tags
|
||||
function bindEditTagsAjax() {
|
||||
// Bind ajax for editing tags
|
||||
function bindEditTagsAjax() {
|
||||
var manageTagsModal = null;
|
||||
var manageTagsModalBody = null;
|
||||
|
||||
|
@ -236,9 +236,9 @@ function bindEditTagsAjax() {
|
|||
$('#manage-module-tags-modal-module').text(data.my_module.name);
|
||||
initTagsModalBody(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function checkStatusState() {
|
||||
function checkStatusState() {
|
||||
$.getJSON($('.status-flow-dropdown').data('status-check-url'), (statusData) => {
|
||||
if (statusData.status_changing) {
|
||||
setTimeout(() => { checkStatusState(); }, STATUS_POLLING_INTERVAL);
|
||||
|
@ -246,9 +246,9 @@ function checkStatusState() {
|
|||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function applyTaskStatusChangeCallBack() {
|
||||
function applyTaskStatusChangeCallBack() {
|
||||
if ($('.status-flow-dropdown').data('status-changing')) {
|
||||
setTimeout(() => { checkStatusState(); }, STATUS_POLLING_INTERVAL);
|
||||
}
|
||||
|
@ -272,9 +272,9 @@ function applyTaskStatusChangeCallBack() {
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initTagsSelector() {
|
||||
function initTagsSelector() {
|
||||
var myModuleTagsSelector = '#module-tags-selector';
|
||||
|
||||
dropdownSelector.init(myModuleTagsSelector, {
|
||||
|
@ -352,9 +352,9 @@ function initTagsSelector() {
|
|||
});
|
||||
}
|
||||
}).getContainer(myModuleTagsSelector).addClass('my-module-tags-container');
|
||||
}
|
||||
}
|
||||
|
||||
function initAssignedUsersSelector() {
|
||||
function initAssignedUsersSelector() {
|
||||
var manageUsersModal = $('#manage-module-users-modal');
|
||||
var manageUsersModalBody = manageUsersModal.find('.modal-body');
|
||||
|
||||
|
@ -407,12 +407,13 @@ function initAssignedUsersSelector() {
|
|||
});
|
||||
|
||||
initUsersEditLink();
|
||||
}
|
||||
}
|
||||
|
||||
initTaskCollapseState();
|
||||
applyTaskStatusChangeCallBack();
|
||||
initTagsSelector();
|
||||
bindEditTagsAjax();
|
||||
initStartDatePicker();
|
||||
initDueDatePicker();
|
||||
initAssignedUsersSelector();
|
||||
initTaskCollapseState();
|
||||
applyTaskStatusChangeCallBack();
|
||||
initTagsSelector();
|
||||
bindEditTagsAjax();
|
||||
initStartDatePicker();
|
||||
initDueDatePicker();
|
||||
initAssignedUsersSelector();
|
||||
}());
|
||||
|
|
Loading…
Add table
Reference in a new issue