mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-02 21:51:51 +08:00
37 lines
878 B
JavaScript
37 lines
878 B
JavaScript
/* global dropdownSelector */
|
|
/* eslint-disable no-param-reassign */
|
|
|
|
var DasboardQuickStartWidget = (function() {
|
|
var projectFilter = '#create-task-modal .project-filter';
|
|
var experimentFilter = '#create-task-modal .experiment-filter';
|
|
|
|
function initNewTaskModal() {
|
|
$('.quick-start-widget .new-task').click(() => {
|
|
$('#create-task-modal').modal('show');
|
|
});
|
|
|
|
dropdownSelector.init(projectFilter, {
|
|
singleSelect: true,
|
|
closeOnSelect: true,
|
|
selectAppearance: 'simple'
|
|
});
|
|
|
|
dropdownSelector.init(experimentFilter, {
|
|
singleSelect: true,
|
|
closeOnSelect: true,
|
|
selectAppearance: 'simple'
|
|
});
|
|
}
|
|
|
|
return {
|
|
init: () => {
|
|
if ($('.quick-start-widget').length) {
|
|
initNewTaskModal();
|
|
}
|
|
}
|
|
};
|
|
}());
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
DasboardQuickStartWidget.init();
|
|
});
|