mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 05:04:35 +08:00
Implement BS tooltips on repository toolbar [SCI-6691] (#4309)
This commit is contained in:
parent
9077b4ace2
commit
ee9c877929
4 changed files with 32 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
globals I18n _ SmartAnnotation FilePreviewModal animateSpinner DataTableHelpers
|
||||
HelperModule RepositoryDatatableRowEditor prepareRepositoryHeaderForExport
|
||||
initAssignedTasksDropdown initBMTFilter initReminderDropdown
|
||||
initAssignedTasksDropdown initBMTFilter initReminderDropdown initBSTooltips
|
||||
*/
|
||||
|
||||
//= require jquery-ui/widgets/sortable
|
||||
|
@ -285,6 +285,8 @@ var RepositoryDatatable = (function(global) {
|
|||
$('#saveRepositoryFilters').removeClass('hidden');
|
||||
}
|
||||
if (typeof initBMTFilter === 'function') initBMTFilter();
|
||||
|
||||
initBSTooltips();
|
||||
});
|
||||
|
||||
TABLE.ajax.reload(null, false);
|
||||
|
@ -598,6 +600,7 @@ var RepositoryDatatable = (function(global) {
|
|||
initItemEditIcon();
|
||||
initSaveButton();
|
||||
initCancelButton();
|
||||
initBSTooltips();
|
||||
|
||||
DataTableHelpers.initLengthAppearance($(TABLE_ID).closest('.dataTables_wrapper'));
|
||||
|
||||
|
|
9
app/assets/javascripts/shared/tooltips.js
Normal file
9
app/assets/javascripts/shared/tooltips.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
function initBSTooltips() {
|
||||
$('[data-toggle="tooltip"]').each(function() {
|
||||
$(this).tooltip();
|
||||
});
|
||||
}
|
||||
|
||||
(function() {
|
||||
$(document).on('turbolinks:load', initBSTooltips);
|
||||
}());
|
|
@ -9,13 +9,13 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<% if can_create_repository_rows?(@repository) %>
|
||||
<button type="button" title="<%= t('repositories.show.button_tooltip.new') %>"
|
||||
<button type="button" data-toggle="tooltip" data-placement="bottom" title="<%= t('repositories.show.button_tooltip.new') %>"
|
||||
class="btn btn-primary editAdd auto-shrink-button"
|
||||
id="addRepositoryRecord" data-view-mode="active">
|
||||
<span class="fas fa-plus"></span>
|
||||
<span class="button-text"><%= t("repositories.add_new_record") %></span>
|
||||
</button>
|
||||
<button type="button" title="<%= t('repositories.show.button_tooltip.import') %>"
|
||||
<button type="button" data-toggle="tooltip" data-placement="bottom" title="<%= t('repositories.show.button_tooltip.import') %>"
|
||||
class="btn btn-light editImport auto-shrink-button"
|
||||
id="importRecordsButton" data-view-mode="active">
|
||||
<span class="fas fa-upload"></span>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<% end %>
|
||||
<%= render partial: 'repositories/toolbar/row_actions' %>
|
||||
<% if @repository.repository_rows.with_active_reminders(current_user).any? %>
|
||||
<button type="button" title="<%= t("repositories.hide_reminders") %>"
|
||||
<button type="button" data-toggle="tooltip" data-placement="bottom" title="<%= t("repositories.hide_reminders") %>"
|
||||
class="btn btn-light auto-shrink-button"
|
||||
id="hideRepositoryReminders"
|
||||
data-view-mode="active"
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<% if can_manage_repository_rows?(@repository) %>
|
||||
<span id="editDeleteCopy" data-toggle="buttons" style="display:none">
|
||||
<%if can_update_repository_rows?(@repository) %>
|
||||
<button type="button" title="<%= t('repositories.show.button_tooltip.edit') %>"
|
||||
<button type="button"
|
||||
data-toggle="tooltip"
|
||||
data-placement="bottom"
|
||||
title="<%= t('repositories.show.button_tooltip.edit') %>"
|
||||
class="btn btn-light editAdd auto-shrink-button"
|
||||
id="editRepositoryRecord" disabled data-view-mode="active">
|
||||
<span class="fas fa-pencil-alt"></span>
|
||||
|
@ -11,7 +14,10 @@
|
|||
|
||||
|
||||
<% if can_create_repository_rows?(@repository) %>
|
||||
<button type="button" title="<%= t('repositories.show.button_tooltip.duplicate') %>"
|
||||
<button type="button"
|
||||
data-toggle="tooltip"
|
||||
data-placement="bottom"
|
||||
title="<%= t('repositories.show.button_tooltip.duplicate') %>"
|
||||
class="btn btn-light copyRow auto-shrink-button"
|
||||
id="copyRepositoryRecords" disabled data-view-mode="active">
|
||||
<span class="fas fa-copy"></span>
|
||||
|
@ -19,12 +25,16 @@
|
|||
</button>
|
||||
<% end %>
|
||||
<button class="btn btn-light auto-shrink-button"
|
||||
data-toggle="tooltip"
|
||||
data-placement="bottom"
|
||||
title="<%= t('repositories.show.button_tooltip.export') %>"
|
||||
id="exportRepositoriesButton">
|
||||
<span class="fas fa-download"></span>
|
||||
<span class="button-text"><%= t("repositories.index.options_dropdown.export_items") %></span>
|
||||
</button>
|
||||
<button type="button" id="toolbarPrintLabel"
|
||||
data-toggle="tooltip"
|
||||
data-placement="bottom"
|
||||
title="<%= t('repositories.show.button_tooltip.print_label') %>"
|
||||
class="btn btn-light print-label-button auto-shrink-button"
|
||||
data-dismiss="modal" data-url="<%= print_modal_repository_repository_rows_path(@repository) %>"
|
||||
|
@ -33,7 +43,10 @@
|
|||
<span class="button-text"><%= t('repository_row.modal_print_label.print_label') %></span>
|
||||
</button>
|
||||
<% if can_delete_repository_rows?(@repository) %>
|
||||
<button type="button" title="<%= t('repositories.show.button_tooltip.archive') %>"
|
||||
<button type="button"
|
||||
data-toggle="tooltip"
|
||||
data-placement="bottom"
|
||||
title="<%= t('repositories.show.button_tooltip.archive') %>"
|
||||
class="btn btn-light auto-shrink-button"
|
||||
id="archiveRepositoryRecordsButton" disabled data-view-mode="active">
|
||||
<span class="fas fa-archive"></span>
|
||||
|
|
Loading…
Add table
Reference in a new issue