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() {
|
||||
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
|
||||
$.ajax({
|
||||
url: modal.attr("data-url"),
|
||||
|
|
|
@ -330,22 +330,21 @@ function importProtocolFromFile(
|
|||
/* Actual import */
|
||||
|
||||
function importCurrentProtocol() {
|
||||
// Check for confirmation first
|
||||
var path = new RegExp("modules");
|
||||
|
||||
var check_linked = $("[data-role='protocol-status-bar']")
|
||||
.text();
|
||||
if( path.test( window.location.href ) && check_linked === '(unlinked)' ){
|
||||
console.log("linked");
|
||||
var confirm_message = "";
|
||||
if( check_linked.trim() !== '(unlinked)' ){
|
||||
confirm_message = I18n.t("protocols.import_export.import_modal.import_to_linked_task");
|
||||
} else {
|
||||
console.log("unlinked");
|
||||
confirm_message = I18n.t("protocols.import_export.import_modal.import_into_protocol_confirm");
|
||||
}
|
||||
|
||||
// Check for confirmation first
|
||||
if (importIntoProtocol && !confirm(confirm_message)) {
|
||||
importModal.modal("hide");
|
||||
} else {
|
||||
|
||||
var path = new RegExp("modules");
|
||||
if( path.test( window.location.href ) ){
|
||||
animateSpinner();
|
||||
importSingleProtocol(currentProtocol, false, function(data) {
|
||||
|
|
Loading…
Add table
Reference in a new issue