mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-20 16:11:27 +08:00
f352c7f186
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]
53 lines
1.6 KiB
JavaScript
53 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');
|
|
}
|
|
});
|
|
});
|
|
}());
|