Skip to content

Commit af6f855

Browse files
author
Jesse McGinnis
committed
Tweaked TableTools to follow other conventions. Updated FixedHeader
1 parent 62d87ae commit af6f855

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

app/assets/javascripts/dataTables/extras/FixedHeader.js renamed to app/assets/javascripts/dataTables/extras/dataTables.fixedHeader.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/*! FixedHeader 2.1.0
1+
/*! FixedHeader 2.1.1
22
* ©2010-2014 SpryMedia Ltd - datatables.net/license
33
*/
44

55
/**
66
* @summary FixedHeader
77
* @description Fix a table's header or footer, so it is always visible while
88
* Scrolling
9-
* @version 2.1.0
9+
* @version 2.1.1
1010
* @file dataTables.fixedHeader.js
1111
* @author SpryMedia Ltd (www.sprymedia.co.uk)
1212
* @contact www.sprymedia.co.uk/contact
@@ -37,20 +37,23 @@ var factory = function( $, DataTable ) {
3737

3838
/*
3939
* Function: FixedHeader
40-
* Purpose: Provide 'fixed' header, footer and columns on an HTML table
40+
* Purpose: Provide 'fixed' header, footer and columns for a DataTable
4141
* Returns: object:FixedHeader - must be called with 'new'
4242
* Inputs: mixed:mTable - target table
43-
* 1. DataTable object - when using FixedHeader with DataTables, or
44-
* 2. HTML table node - when using FixedHeader without DataTables
45-
* object:oInit - initialisation settings, with the following properties (each optional)
46-
* bool:top - fix the header (default true)
47-
* bool:bottom - fix the footer (default false)
48-
* int:left - fix the left column(s) (default 0)
49-
* int:right - fix the right column(s) (default 0)
50-
* int:zTop - fixed header zIndex
51-
* int:zBottom - fixed footer zIndex
52-
* int:zLeft - fixed left zIndex
53-
* int:zRight - fixed right zIndex
43+
* @param {object} dt DataTables instance or HTML table node. With DataTables
44+
* 1.10 this can also be a jQuery collection (with just a single table in its
45+
* result set), a jQuery selector, DataTables API instance or settings
46+
* object.
47+
* @param {object} [oInit] initialisation settings, with the following
48+
* properties (each optional)
49+
* * bool:top - fix the header (default true)
50+
* * bool:bottom - fix the footer (default false)
51+
* * int:left - fix the left column(s) (default 0)
52+
* * int:right - fix the right column(s) (default 0)
53+
* * int:zTop - fixed header zIndex
54+
* * int:zBottom - fixed footer zIndex
55+
* * int:zLeft - fixed left zIndex
56+
* * int:zRight - fixed right zIndex
5457
*/
5558
FixedHeader = function ( mTable, oInit ) {
5659
/* Sanity check - you just know it will happen */
@@ -213,12 +216,12 @@ FixedHeader.prototype = {
213216
} );
214217

215218
$(s.nTable)
216-
.on('column-reorder', function () {
219+
.on('column-reorder.dt', function () {
217220
FixedHeader.fnMeasure();
218221
that._fnUpdateClones( true );
219222
that._fnUpdatePositions();
220223
} )
221-
.on('column-visibility', function () {
224+
.on('column-visibility.dt', function () {
222225
FixedHeader.fnMeasure();
223226
that._fnUpdateClones( true );
224227
that._fnUpdatePositions();
@@ -979,7 +982,7 @@ FixedHeader.fnMeasure = function ()
979982
};
980983

981984

982-
FixedHeader.version = "2.1.0";
985+
FixedHeader.version = "2.1.1";
983986

984987

985988
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

app/assets/stylesheets/dataTables/extras/TableTools.css.erb renamed to app/assets/stylesheets/dataTables/extras/TableTools.css.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ a.DTTT_button_print:hover span { background: #f0f0f0 url(../images/print_hover.p
161161
button.DTTT_button_collection span {
162162
padding-right: 17px;
163163

164-
background: url(<%= asset_path 'dataTables/extras/collection.png' %>) no-repeat center right;
164+
background: image-url('dataTables/extras/collection.png') no-repeat center right;
165165
}
166166

167167
button.DTTT_button_collection:hover span {
168168
padding-right: 17px;
169-
background: #f0f0f0 url(<%= asset_path 'dataTables/extras/collection_hover.png' %>) no-repeat center right;
169+
background: #f0f0f0 image-url('dataTables/extras/collection_hover.png') no-repeat center right;
170170
}
171171

172172

@@ -242,7 +242,7 @@ div.DTTT_collection {
242242
}
243243

244244
div.DTTT_collection_background {
245-
background: transparent url(<%= asset_path 'dataTables/extras/background.png' %>) repeat top left;
245+
background: transparent image-url('dataTables/extras/background.png') repeat top left;
246246
z-index: 2001;
247247
}
248248

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
div.FixedHeader_Cloned th,
4+
div.FixedHeader_Cloned td {
5+
background-color: white !important;
6+
}
7+

0 commit comments

Comments
 (0)