scinote-web/app/assets/javascripts/sitewide/repository_row_card.js
Gregor Lasnibat f352c7f186 Working on new behaviour for switching between item clicks [SCI-9354]
Working on scrolling and highlighting [SCI-9354]

Item card preload and section title animation [SCI-9354]

Added box-shadow [SCI-9354]

Refactored logic and styles [SCI-9354]

PR fix, added back the missing HighlightComponent [SCI-9354]

PR fixes, refactoring [SCI-9354]

PR fix [SCI-9354]

Fixed scrolling to 'Assigned', highlighting [SCI-9354]

PR fix, modular logic, rename [SCI-9354]
2023-09-28 13:21:20 +02:00

54 lines
1.6 KiB
JavaScript

/* global PrintModalComponent RepositoryDatatable HelperModule MyModuleRepositories */
(function() {
'use strict';
$(document).on('click', '.record-info-link', function(e) {
e.stopPropagation();
e.preventDefault();
const repositoryRowURL = $(this).attr('href');
window.repositoryItemSidebarComponent.toggleShowHideSidebar(repositoryRowURL);
});
$(document).on('click', '.print-label-button', function(e) {
var selectedRows = $(this).data('rows');
e.preventDefault();
e.stopPropagation();
if (typeof PrintModalComponent !== 'undefined') {
PrintModalComponent.showModal = true;
if (selectedRows && selectedRows.length) {
$('#modal-info-repository-row').modal('hide');
PrintModalComponent.row_ids = selectedRows;
} else {
PrintModalComponent.row_ids = [...RepositoryDatatable.selectedRows()];
}
}
});
$(document).on('click', '.assign-inventory-button', function(e) {
e.preventDefault();
let assignUrl = $(this).data('assignUrl');
let repositoryRowId = $(this).data('repositoryRowId');
$.ajax({
url: assignUrl,
type: 'POST',
data: { repository_row_id: repositoryRowId },
dataType: 'json',
success: function(data) {
HelperModule.flashAlertMsg(data.flash, 'success');
$('#modal-info-repository-row').modal('hide');
if (typeof MyModuleRepositories !== 'undefined') {
MyModuleRepositories.reloadRepositoriesList(repositoryRowId);
}
},
error: function(error) {
HelperModule.flashAlertMsg(error.responseJSON.flash, 'danger');
}
});
});
}());