Merge pull request #1128 from ZmagoD/zd_SCI_2331

adds deface hook in support dropdown [fixes SCI-2331]
This commit is contained in:
Zmago Devetak 2018-05-18 09:31:02 +02:00 committed by GitHub
commit c3d247faae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 57 deletions

View file

@ -30,7 +30,6 @@
//= require tinymce-jquery
//= require jsPlumb-2.0.4-min
//= require jsnetworkx
//= require dataTables.noSearchHidden
//= require bootstrap-select
//= require_directory ./sitewide
//= require jquery.dataTables.yadcf

View file

@ -249,9 +249,6 @@ var RepositoryDatatable = (function(global) {
return TABLE;
}
// Enables noSearchHidden plugin
$.fn.dataTable.defaults.noSearchHidden = true;
function bindExportActions() {
$('form#form-export').submit(function() {
var form = this;

View file

@ -271,10 +271,6 @@ setTimeout(function () {
table.columns.adjust();
}, 10);
// Enables noSearchHidden plugin
$.fn.dataTable.defaults.noSearchHidden = true;
// Updates "Select all" control in a data table
function updateDataTableSelectAllCtrl(table) {
var $table = table.table().node();

View file

@ -58,7 +58,7 @@
<span class="glyphicon glyphicon-paperclip"></span>
<span><%= t('left_menu_bar.support') %></span>
</a>
<ul class="dropdown-menu">
<ul class="dropdown-menu" data-hook="support-dropdown">
<li><%= link_to t('left_menu_bar.support_links.support'),
Constants::SUPPORT_URL,
target: "_blank" %></li>

View file

@ -1,48 +0,0 @@
/**
* @summary NoSearchHidden
* @description Prevent searching of cells in hidden columns in DataTables
* @version 1.0.0
* @file dataTables.noSearchHidden.js
* @author Brian White
* @contact github.com/mscdex/dataTables.noSearchHidden
* @copyright Copyright 2014 Brian White
*
* License MIT - http://opensource.org/licenses/MIT
*
* This feature plug-in for DataTables will prevent searching of cells located
* in hidden columns. This behavior is dynamic, so as column visibility
* changes, so does the search cache.
*
* This feature can be enabled by:
*
* * Setting the `noSearchHidden` parameter in the DataTables initialization to
* be true
* * Setting the `noSearchHidden` parameter to be true in the DataTables
* defaults (thus causing all tables to have this feature) - i.e.
* `$.fn.dataTable.defaults.noSearchHidden = true`.
*
*/
(function(window, document, $) {
// Listen for DataTables initializations
$(document).on('init.dt.dth', function(e, settings, json) {
//console.log("out");
if (
settings.oInit.noSearchHidden || // option specified
$.fn.dataTable.defaults.noSearchHidden // default set
) {
//console.log("in");
var table = new $.fn.dataTable.Api(settings),
aoColumns = table.settings()[0].aoColumns;
//console.log(table);
table.on('column-visibility.dt.dth', function(e, settings, column, state) {
var col = aoColumns[column];
col.searchable = col.bSearchable = state;
table.rows().invalidate();
}).on('destroy', function() {
// Remove event handler
table.off('column-visibility.dt.dth');
});
}
});
})(window, document, jQuery);