mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Disable inventories table initialization on turbolinks preview
This commit is contained in:
parent
7aa40a284e
commit
50714eb59d
|
@ -274,3 +274,8 @@ var HelperModule = (function(){
|
||||||
tinymce.remove();
|
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() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
|
|
||||||
function initRepositoriesDataTable(tableContainer, archived = false) {
|
function initRepositoriesDataTable(tableContainer, archived = false) {
|
||||||
var tableTemplate = $('#RepositoriesListTable').html();
|
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();
|
if (REPOSITORIES_TABLE) REPOSITORIES_TABLE.destroy();
|
||||||
CHECKBOX_SELECTOR = null;
|
CHECKBOX_SELECTOR = null;
|
||||||
$('.content-body').html(tableTemplate);
|
$('.content-body').html(tableTemplate);
|
||||||
|
@ -187,6 +188,8 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.create-new-repository').initializeModal('#create-repo-modal');
|
$('.create-new-repository').initializeModal('#create-repo-modal');
|
||||||
initRepositoriesDataTable('#repositoriesList', $('.repositories-index').hasClass('archived'));
|
if (notTurbolinksPreview()) {
|
||||||
|
initRepositoriesDataTable('#repositoriesList', $('.repositories-index').hasClass('archived'));
|
||||||
|
}
|
||||||
initRepositoryViewSwitcher();
|
initRepositoryViewSwitcher();
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in a new issue