mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-28 11:14:24 +08:00
Disable inventories table initialization on turbolinks preview
This commit is contained in:
parent
7aa40a284e
commit
50714eb59d
2 changed files with 11 additions and 3 deletions
|
@ -274,3 +274,8 @@ var HelperModule = (function(){
|
|||
tinymce.remove();
|
||||
});
|
||||
})();
|
||||
|
||||
// Check that loaded page, not turbolinks preview
|
||||
function notTurbolinksPreview() {
|
||||
return !document.documentElement.hasAttribute("data-turbolinks-preview");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global I18n animateSpinner HelperModule DataTableHelpers DataTableCheckboxes */
|
||||
/* global I18n animateSpinner HelperModule
|
||||
DataTableHelpers DataTableCheckboxes notTurbolinksPreview */
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
|
@ -32,7 +33,7 @@
|
|||
|
||||
function initRepositoriesDataTable(tableContainer, archived = false) {
|
||||
var tableTemplate = $('#RepositoriesListTable').html();
|
||||
$.get($(tableTemplate).data('source'), {archived: archived}, function(data) {
|
||||
$.get($(tableTemplate).data('source'), { archived: archived }, function(data) {
|
||||
if (REPOSITORIES_TABLE) REPOSITORIES_TABLE.destroy();
|
||||
CHECKBOX_SELECTOR = null;
|
||||
$('.content-body').html(tableTemplate);
|
||||
|
@ -187,6 +188,8 @@
|
|||
});
|
||||
|
||||
$('.create-new-repository').initializeModal('#create-repo-modal');
|
||||
initRepositoriesDataTable('#repositoriesList', $('.repositories-index').hasClass('archived'));
|
||||
if (notTurbolinksPreview()) {
|
||||
initRepositoriesDataTable('#repositoriesList', $('.repositories-index').hasClass('archived'));
|
||||
}
|
||||
initRepositoryViewSwitcher();
|
||||
}());
|
||||
|
|
Loading…
Reference in a new issue