mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-01 10:44:21 +08:00
Fix modals handling with Turbolinks [SCI-2253]
This commit is contained in:
parent
1c3f1a1a6c
commit
38c36ab798
6 changed files with 2736 additions and 2722 deletions
|
@ -256,5 +256,10 @@ var HelperModule = (function(){
|
|||
|
||||
// fix dropdown-menu style throughout the app
|
||||
$('.dropdown-header').parent('ul').addClass('custom-dropdown-menu');
|
||||
|
||||
// Close all open modals before caching
|
||||
$(document).on('turbolinks:before-cache', function() {
|
||||
$('.modal').modal('hide');
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* globals animateSpinner */
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
<%= link_to t('protocols.index.archive_results.preview'), download_asset_path(result.asset),
|
||||
class: 'file-preview-link',
|
||||
id: "modal_link#{result.asset.id}",
|
||||
data: { no_turbolink: true, id: true, status: 'asset-present', 'preview-url': asset_file_preview_path(result.asset) } %>
|
||||
data: { turbolinks: false, id: true, status: 'asset-present', 'preview-url': asset_file_preview_path(result.asset) } %>
|
||||
<% elsif result.is_text %>
|
||||
<%= link_to option_text, result_text_download_path(result.result_text_id), data: {no_turbolink: true} %>
|
||||
<%= link_to option_text, result_text_download_path(result.result_text_id), data: { turbolinks: false } %>
|
||||
<% elsif result.is_table %>
|
||||
<%= link_to option_text, result_table_download_path(result.result_table_id), data: {no_turbolink: true} %>
|
||||
<%= link_to option_text, result_table_download_path(result.result_table_id), data: { turbolinks: false } %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% if can_manage_result?(result) %>
|
||||
|
|
|
@ -70,9 +70,9 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "#modal-import-json-protocol", "data-toggle" => "modal" do %>
|
||||
<span class="fas fa-file"></span>
|
||||
<span class="hidden-xs"><%= t("protocols.index.import_json") %></span>
|
||||
<%= link_to "#modal-import-json-protocol", data: { toggle: 'modal', remote: true } do %>
|
||||
<span class="fas fa-file"></span>
|
||||
<span class="hidden-xs"><%= t("protocols.index.import_json") %></span>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
5438
package-lock.json
generated
5438
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -31,6 +31,7 @@
|
|||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-flowtype": "^2.50.0",
|
||||
"eslint-plugin-import": "^2.13.0",
|
||||
"eslint-plugin-jquery": "^1.3.1",
|
||||
"eslint-plugin-jsx-a11y": "^5.1.1",
|
||||
"eslint-plugin-prettier": "^2.6.2",
|
||||
"eslint-plugin-react": "^7.10.0",
|
||||
|
|
Loading…
Add table
Reference in a new issue