mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 12:14:37 +08:00
fixed protocol status bar [fixes SCI-318]
This commit is contained in:
parent
5e647f62d5
commit
76dd4bc90a
2 changed files with 17 additions and 8 deletions
|
@ -453,7 +453,17 @@ function destroyLoadFromRepositoryTable(content) {
|
||||||
function loadFromRepository() {
|
function loadFromRepository() {
|
||||||
var modal = $("#load-from-repository-modal");
|
var modal = $("#load-from-repository-modal");
|
||||||
|
|
||||||
if (selectedRow !== null && confirm(I18n.t("my_modules.protocols.load_from_repository_modal.confirm_message"))) {
|
var check_linked = $("[data-role='protocol-status-bar']")
|
||||||
|
.text();
|
||||||
|
|
||||||
|
var confirm_message= "";
|
||||||
|
if( check_linked.trim() !== '(unlinked)' ){
|
||||||
|
confirm_message = I18n.t("protocols.import_export.import_modal.import_to_linked_task");
|
||||||
|
} else {
|
||||||
|
confirm_message = I18n.t("my_modules.protocols.load_from_repository_modal.confirm_message");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedRow !== null && confirm(confirm_message) ) {
|
||||||
// POST via ajax
|
// POST via ajax
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: modal.attr("data-url"),
|
url: modal.attr("data-url"),
|
||||||
|
@ -549,4 +559,4 @@ initLoadFromRepository();
|
||||||
initRefreshStatusBar();
|
initRefreshStatusBar();
|
||||||
initImport();
|
initImport();
|
||||||
initExport();
|
initExport();
|
||||||
initTutorial();
|
initTutorial();
|
||||||
|
|
|
@ -330,22 +330,21 @@ function importProtocolFromFile(
|
||||||
/* Actual import */
|
/* Actual import */
|
||||||
|
|
||||||
function importCurrentProtocol() {
|
function importCurrentProtocol() {
|
||||||
// Check for confirmation first
|
|
||||||
var path = new RegExp("modules");
|
|
||||||
var check_linked = $("[data-role='protocol-status-bar']")
|
var check_linked = $("[data-role='protocol-status-bar']")
|
||||||
.text();
|
.text();
|
||||||
if( path.test( window.location.href ) && check_linked === '(unlinked)' ){
|
var confirm_message = "";
|
||||||
console.log("linked");
|
if( check_linked.trim() !== '(unlinked)' ){
|
||||||
confirm_message = I18n.t("protocols.import_export.import_modal.import_to_linked_task");
|
confirm_message = I18n.t("protocols.import_export.import_modal.import_to_linked_task");
|
||||||
} else {
|
} else {
|
||||||
console.log("unlinked");
|
|
||||||
confirm_message = I18n.t("protocols.import_export.import_modal.import_into_protocol_confirm");
|
confirm_message = I18n.t("protocols.import_export.import_modal.import_into_protocol_confirm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for confirmation first
|
||||||
if (importIntoProtocol && !confirm(confirm_message)) {
|
if (importIntoProtocol && !confirm(confirm_message)) {
|
||||||
importModal.modal("hide");
|
importModal.modal("hide");
|
||||||
} else {
|
} else {
|
||||||
|
var path = new RegExp("modules");
|
||||||
if( path.test( window.location.href ) ){
|
if( path.test( window.location.href ) ){
|
||||||
animateSpinner();
|
animateSpinner();
|
||||||
importSingleProtocol(currentProtocol, false, function(data) {
|
importSingleProtocol(currentProtocol, false, function(data) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue