mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-09 05:37:36 +08:00
Update turbolinks and fix repository table init [SCI-2251]
This commit is contained in:
parent
2356b78044
commit
83c7539156
8 changed files with 27 additions and 20 deletions
3
Gemfile
3
Gemfile
|
|
@ -30,7 +30,6 @@ gem 'bootstrap3-datetimepicker-rails', '~> 4.15.35'
|
|||
gem 'bootstrap-select-rails', '~> 1.6.3'
|
||||
gem 'uglifier', '>= 1.3.0'
|
||||
# jQuery & plugins
|
||||
gem 'jquery-turbolinks'
|
||||
gem 'jquery-rails'
|
||||
gem 'jquery-ui-rails'
|
||||
gem 'jquery-scrollto-rails',
|
||||
|
|
@ -42,7 +41,7 @@ gem 'spinjs-rails'
|
|||
gem 'autosize-rails' # jQuery autosize plugin
|
||||
|
||||
gem 'underscore-rails'
|
||||
gem 'turbolinks', '~> 2.0'
|
||||
gem 'turbolinks', '~> 5.0.1'
|
||||
gem 'sdoc', '~> 0.4.0', group: :doc
|
||||
gem 'bcrypt', '~> 3.1.10'
|
||||
gem 'logging', '~> 2.0.0'
|
||||
|
|
|
|||
16
Gemfile.lock
16
Gemfile.lock
|
|
@ -1,10 +1,11 @@
|
|||
GIT
|
||||
remote: https://github.com/biosistemika/canaid
|
||||
revision: f2000c19b75e66ea929a44cb0575262b7f5fc13e
|
||||
revision: 943ae9b9801819fd2513f6ab9e1143ad8de523ce
|
||||
branch: master
|
||||
specs:
|
||||
canaid (1.0.1)
|
||||
canaid (1.0.2)
|
||||
devise (>= 3.4.1)
|
||||
docile (>= 1.1.0)
|
||||
rails (>= 4)
|
||||
|
||||
GIT
|
||||
|
|
@ -242,9 +243,6 @@ GEM
|
|||
rails-dom-testing (>= 1, < 3)
|
||||
railties (>= 4.2.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-turbolinks (2.1.0)
|
||||
railties (>= 3.1.0)
|
||||
turbolinks
|
||||
jquery-ui-rails (6.0.1)
|
||||
railties (>= 3.2.16)
|
||||
js_cookie_rails (2.1.4)
|
||||
|
|
@ -491,8 +489,9 @@ GEM
|
|||
tilt (2.0.8)
|
||||
tinymce-rails (4.6.7)
|
||||
railties (>= 3.1.1)
|
||||
turbolinks (2.5.4)
|
||||
coffee-rails
|
||||
turbolinks (5.0.1)
|
||||
turbolinks-source (~> 5)
|
||||
turbolinks-source (5.1.0)
|
||||
tzinfo (1.2.4)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (4.1.4)
|
||||
|
|
@ -562,7 +561,6 @@ DEPENDENCIES
|
|||
jbuilder
|
||||
jquery-rails
|
||||
jquery-scrollto-rails!
|
||||
jquery-turbolinks
|
||||
jquery-ui-rails
|
||||
js_cookie_rails
|
||||
json_matchers
|
||||
|
|
@ -609,7 +607,7 @@ DEPENDENCIES
|
|||
spinjs-rails
|
||||
starscope
|
||||
tinymce-rails (~> 4.6.4)
|
||||
turbolinks (~> 2.0)
|
||||
turbolinks (~> 5.0.1)
|
||||
tzinfo-data
|
||||
uglifier (>= 1.3.0)
|
||||
underscore-rails
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
// jquery.turbolinks MUST IMMEDIATELY FOLLOW jquery inclusion
|
||||
// turbolinks MUST BE THE LAST inclusion
|
||||
//= require jquery
|
||||
//= require jquery.turbolinks
|
||||
//= require jquery_ujs
|
||||
//= require jquery.remotipart
|
||||
//= require jquery.mousewheel.min
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
'use strict';
|
||||
|
||||
// initialze repository datatable
|
||||
$(document).ready(function() {
|
||||
RepositoryDatatable.destroy()
|
||||
RepositoryDatatable.init($('#content').attr('data-repo-id'));
|
||||
onClickToggleAssignedRecords();
|
||||
});
|
||||
RepositoryDatatable.destroy();
|
||||
RepositoryDatatable.init($('#content').attr('data-repo-id'));
|
||||
onClickToggleAssignedRecords();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ var RepositoryDatatable = (function(global) {
|
|||
'use strict';
|
||||
|
||||
var TABLE_ID = '';
|
||||
var TABLE = {};
|
||||
var TABLE = null;
|
||||
|
||||
// Extend datatables API with searchable options
|
||||
// (http://stackoverflow.com/questions/39912395/datatables-dynamically-set-columns-searchable)
|
||||
|
|
@ -1405,7 +1405,10 @@ var RepositoryDatatable = (function(global) {
|
|||
}
|
||||
|
||||
function destroy() {
|
||||
TABLE = {};
|
||||
if (TABLE !== null) {
|
||||
TABLE.destroy();
|
||||
TABLE = null;
|
||||
}
|
||||
TABLE_ID = '';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@
|
|||
<%= favicon_link_tag "favicon-48.png", type: "image/png", size: "48x48" %>
|
||||
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<% if content_for?(:head) %>
|
||||
<%= yield(:head) %>
|
||||
<% end %>
|
||||
</head>
|
||||
<body
|
||||
class="<%= yield :body_class %>"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
<% content_for :head do %>
|
||||
<meta name="turbolinks-cache-control" content="no-cache">
|
||||
<% end %>
|
||||
<% provide(:head_title, t("my_modules.repository.head_title",
|
||||
project: h(@project.name),
|
||||
module: h(@my_module.name),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
<% content_for :head do %>
|
||||
<meta name="turbolinks-cache-control" content="no-cache">
|
||||
<% end %>
|
||||
|
||||
<% provide(:head_title, t("repositories.index.head_title")) %>
|
||||
|
||||
<% if current_team %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue