rapid-router 5.18.0__py2.py3-none-any.whl → 7.6.8__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. example_project/rapid_router_test_settings.py +19 -7
  2. example_project/settings.py +21 -8
  3. example_project/urls.py +5 -6
  4. game/__init__.py +1 -1
  5. game/admin.py +7 -2
  6. game/character.py +8 -0
  7. game/decor.py +40 -0
  8. game/end_to_end_tests/base_game_test.py +34 -27
  9. game/end_to_end_tests/editor_page.py +15 -0
  10. game/end_to_end_tests/game_page.py +88 -20
  11. game/end_to_end_tests/selenium_test_case.py +1 -20
  12. game/end_to_end_tests/test_cow_crashes.py +3 -5
  13. game/end_to_end_tests/test_level_editor.py +273 -10
  14. game/end_to_end_tests/test_level_selection.py +25 -3
  15. game/end_to_end_tests/test_play_through.py +222 -127
  16. game/end_to_end_tests/test_python_levels.py +41 -7
  17. game/end_to_end_tests/test_saving_workspace.py +2 -1
  18. game/forms.py +7 -1
  19. game/level_management.py +26 -11
  20. game/messages.py +899 -337
  21. game/migrations/0001_squashed_0025_levels_ordering_pt1.py +19 -1
  22. game/migrations/0026_levels_pt2.py +13 -2
  23. game/migrations/0032_cannot_turn_left_level.py +13 -2
  24. game/migrations/0033_recursion_level.py +13 -2
  25. game/migrations/0034_joes_level.py +13 -2
  26. game/migrations/0035_disable_route_score_level_70.py +0 -2
  27. game/migrations/0036_level_score_73.py +0 -2
  28. game/migrations/0037_level_score_79.py +0 -2
  29. game/migrations/0038_level_score_40.py +0 -1
  30. game/migrations/0042_level_score_73.py +0 -2
  31. game/migrations/0048_add_cow_field_and_blocks.py +0 -2
  32. game/migrations/0049_level_score_34.py +0 -2
  33. game/migrations/0050_level_score_40.py +0 -2
  34. game/migrations/0051_level_score_49.py +0 -1
  35. game/migrations/0086_loop_levels.py +13 -2
  36. game/migrations/0092_disable_algo_score_in_custom_levels.py +28 -0
  37. game/migrations/0093_alter_level_character_name.py +18 -0
  38. game/migrations/0094_add_hint_lesson_subtitle_to_levels.py +28 -0
  39. game/migrations/0095_level_commands.py +18 -0
  40. game/migrations/0096_alter_level_commands.py +18 -0
  41. game/migrations/0097_add_python_den_levels.py +1515 -0
  42. game/migrations/0098_add_episode_link_fields.py +44 -0
  43. game/migrations/0099_python_episodes_links.py +103 -0
  44. game/migrations/0100_reorder_python_levels.py +179 -0
  45. game/migrations/0101_rename_episodes.py +45 -0
  46. game/migrations/0102_reoder_episodes_13_14.py +136 -0
  47. game/migrations/0103_level_1015_solution.py +26 -0
  48. game/migrations/0104_remove_level_direct_drive.py +17 -0
  49. game/migrations/0105_delete_invalid_attempts.py +18 -0
  50. game/migrations/0106_fields_to_snake_case.py +48 -0
  51. game/migrations/0107_rename_worksheet_link_episode_student_worksheet_link.py +18 -0
  52. game/migrations/0108_episode_indy_worksheet_link.py +18 -0
  53. game/migrations/0109_create_episodes_23_and_24.py +99 -0
  54. game/migrations/0110_remove_episode_indy_worksheet_link_and_more.py +100 -0
  55. game/migrations/0111_create_worksheets.py +149 -0
  56. game/migrations/0112_worksheet_locked_classes.py +21 -0
  57. game/migrations/0113_level_needs_approval.py +18 -0
  58. game/migrations/0114_default_and_non_student_levels_no_approval.py +31 -0
  59. game/migrations/0115_level_level__default_does_not_need_approval.py +22 -0
  60. game/migrations/0116_update_worksheet_video_links.py +68 -0
  61. game/migrations/0117_update_solutions_to_if_else.py +61 -0
  62. game/models.py +127 -17
  63. game/permissions.py +51 -19
  64. game/python_den_urls.py +26 -0
  65. game/random_road.py +9 -9
  66. game/serializers.py +12 -17
  67. game/static/django_reverse_js/js/reverse.js +171 -0
  68. game/static/game/css/LilitaOne-Regular.ttf +0 -0
  69. game/static/game/css/backgrounds.css +8 -12
  70. game/static/game/css/dataTables.custom.css +3 -2
  71. game/static/game/css/editor.css +47 -0
  72. game/static/game/css/game.css +37 -43
  73. game/static/game/css/game_screen.css +16 -0
  74. game/static/game/css/level_editor.css +5 -0
  75. game/static/game/css/level_selection.css +17 -2
  76. game/static/game/image/Python_Den_hero_student.png +0 -0
  77. game/static/game/image/Python_levels_page.svg +1954 -0
  78. game/static/game/image/characters/front_view/Electric_van.svg +448 -0
  79. game/static/game/image/characters/top_view/Electric_van.svg +448 -0
  80. game/static/game/image/decor/city/solar_panel.svg +1200 -0
  81. game/static/game/image/decor/farm/solar_panel.svg +86 -0
  82. game/static/game/image/decor/grass/solar_panel.svg +86 -0
  83. game/static/game/image/decor/snow/solar_panel.svg +173 -0
  84. game/static/game/image/electric_van.svg +448 -0
  85. game/static/game/image/icons/description.svg +1 -0
  86. game/static/game/image/icons/hint.svg +1 -0
  87. game/static/game/image/icons/python.svg +1 -1
  88. game/static/game/image/pigeon.svg +684 -0
  89. game/static/game/image/python_den_header.svg +19 -0
  90. game/static/game/js/animation.js +65 -24
  91. game/static/game/js/blockly/msg/js/bg.js +52 -1
  92. game/static/game/js/blockly/msg/js/ca.js +52 -1
  93. game/static/game/js/blockly/msg/js/en-gb.js +2 -0
  94. game/static/game/js/blockly/msg/js/en.js +2 -0
  95. game/static/game/js/blockly/msg/js/es.js +52 -1
  96. game/static/game/js/blockly/msg/js/fr.js +2 -0
  97. game/static/game/js/blockly/msg/js/hi.js +2 -0
  98. game/static/game/js/blockly/msg/js/it.js +52 -1
  99. game/static/game/js/blockly/msg/js/pl.js +52 -1
  100. game/static/game/js/blockly/msg/js/pt-br.js +52 -1
  101. game/static/game/js/blockly/msg/js/ru.js +52 -1
  102. game/static/game/js/blockly/msg/js/ur.js +52 -1
  103. game/static/game/js/blocklyCustomBlocks.js +93 -52
  104. game/static/game/js/button.js +12 -0
  105. game/static/game/js/cow.js +11 -7
  106. game/static/game/js/drawing.js +68 -29
  107. game/static/game/js/editor.js +23 -0
  108. game/static/game/js/game.js +74 -110
  109. game/static/game/js/level_editor.js +646 -274
  110. game/static/game/js/level_moderation.js +33 -2
  111. game/static/game/js/level_selection.js +1 -1
  112. game/static/game/js/loadLanguages.js +2 -2
  113. game/static/game/js/model.js +32 -2
  114. game/static/game/js/pythonControl.js +14 -1
  115. game/static/game/js/scoreboard.js +0 -37
  116. game/static/game/js/scoreboardSharedLevels.js +48 -0
  117. game/static/game/js/skulpt/skulpt-stdlib.js +1 -1
  118. game/static/game/js/sound.js +52 -5
  119. game/static/game/raphael_image/characters/top_view/Electric_van.svg +448 -0
  120. game/static/game/raphael_image/decor/city/solar_panel.svg +1200 -0
  121. game/static/game/raphael_image/decor/farm/solar_panel.svg +86 -0
  122. game/static/game/raphael_image/decor/grass/solar_panel.svg +86 -0
  123. game/static/game/raphael_image/decor/snow/solar_panel.svg +173 -0
  124. game/static/game/raphael_image/pigeon.svg +685 -0
  125. game/static/game/sass/game.scss +2 -2
  126. game/static/game/sound/clown_horn.mp3 +0 -0
  127. game/static/game/sound/clown_horn.ogg +0 -0
  128. game/static/game/sound/electric_van_starting.mp3 +0 -0
  129. game/static/game/sound/electric_van_starting.ogg +0 -0
  130. game/static/game/sound/pigeon.mp3 +0 -0
  131. game/static/game/sound/pigeon.ogg +0 -0
  132. game/static/game/sound/sleigh_bells.mp3 +0 -0
  133. game/static/game/sound/sleigh_bells.ogg +0 -0
  134. game/static/game/sound/sleigh_crash.mp3 +0 -0
  135. game/static/game/sound/sleigh_crash.ogg +0 -0
  136. game/templates/game/base.html +34 -14
  137. game/templates/game/basenonav.html +11 -5
  138. game/templates/game/game.html +142 -38
  139. game/templates/game/level_editor.html +340 -236
  140. game/templates/game/level_moderation.html +19 -6
  141. game/templates/game/level_selection.html +18 -110
  142. game/templates/game/python_den_level_selection.html +291 -0
  143. game/templates/game/python_den_worksheet.html +101 -0
  144. game/templates/game/scoreboard.html +83 -64
  145. game/tests/test_level_editor.py +94 -26
  146. game/tests/test_level_selection.py +149 -46
  147. game/tests/test_python_den_worksheet.py +85 -0
  148. game/tests/test_scoreboard.py +34 -7
  149. game/tests/utils/level.py +32 -26
  150. game/theme.py +5 -5
  151. game/urls.py +199 -61
  152. game/views/language_code_conversions.py +86 -86
  153. game/views/level.py +155 -63
  154. game/views/level_editor.py +88 -55
  155. game/views/level_moderation.py +23 -0
  156. game/views/level_selection.py +116 -47
  157. game/views/level_solutions.py +491 -106
  158. game/views/scoreboard.py +76 -51
  159. game/views/worksheet.py +25 -0
  160. rapid_router-7.6.8.dist-info/METADATA +174 -0
  161. {rapid_router-5.18.0.dist-info → rapid_router-7.6.8.dist-info}/RECORD +164 -104
  162. {rapid_router-5.18.0.dist-info → rapid_router-7.6.8.dist-info}/WHEEL +1 -1
  163. example_project/manage.py +0 -10
  164. game/static/game/image/actions/go.svg +0 -18
  165. game/static/game/js/js-reverse.js +0 -14
  166. game/static/game/js/pqselect.min.js +0 -9
  167. game/static/game/js/widget-scroller.js +0 -906
  168. rapid_router-5.18.0.dist-info/METADATA +0 -17
  169. {rapid_router-5.18.0.dist-info → rapid_router-7.6.8.dist-info/licenses}/LICENSE.md +0 -0
  170. {rapid_router-5.18.0.dist-info → rapid_router-7.6.8.dist-info}/top_level.txt +0 -0
@@ -1,906 +0,0 @@
1
- /*! Widget: scroller - updated 5/17/2015 (v2.22.0) *//*
2
- Copyright (C) 2011 T. Connell & Associates, Inc.
3
-
4
- Dual-licensed under the MIT and GPL licenses
5
-
6
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
7
- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
8
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
9
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
10
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11
-
12
- Resizable scroller widget for the jQuery tablesorter plugin
13
-
14
- Version 2.0 - modified by Rob Garrison 4/12/2013;
15
- updated 3/5/2015 (v2.22.2) with lots of help from TheSin-
16
- Requires jQuery v1.7+
17
- Requires the tablesorter plugin, v2.8+, available at http://mottie.github.com/tablesorter/docs/
18
-
19
- Usage:
20
- $(function() {
21
- $('table.tablesorter').tablesorter({
22
- widgets: ['zebra', 'scroller'],
23
- widgetOptions : {
24
- scroller_height : 300, // height of scroll window
25
- scroller_jumpToHeader : true, // header snap to browser top when scrolling the tbody
26
- scroller_upAfterSort : true, // scroll tbody to top after sorting
27
- scroller_fixedColumns : 0 // set number of fixed columns
28
- }
29
- });
30
- });
31
-
32
- Website: www.tconnell.com
33
- */
34
- /*jshint browser:true, jquery:true, unused:false */
35
- ;( function( $, window ) {
36
- 'use strict';
37
-
38
- var ts = $.tablesorter,
39
- tscss = ts.css;
40
-
41
- $.extend( ts.css, {
42
- scrollerWrap : 'tablesorter-scroller',
43
- scrollerHeader : 'tablesorter-scroller-header',
44
- scrollerTable : 'tablesorter-scroller-table',
45
- scrollerFooter : 'tablesorter-scroller-footer',
46
- scrollerFixed : 'tablesorter-scroller-fixed',
47
- scrollerFixedPanel : 'tablesorter-scroller-fixed-panel',
48
- scrollerHasFix : 'tablesorter-scroller-has-fixed-columns',
49
- scrollerHideColumn : 'tablesorter-scroller-hidden-column',
50
- scrollerHideElement : 'tablesorter-scroller-hidden',
51
- scrollerSpacerRow : 'tablesorter-scroller-spacer',
52
- scrollerBarSpacer : 'tablesorter-scroller-bar-spacer',
53
- scrollerAddedHeight : 'tablesorter-scroller-added-height',
54
- scrollerHack : 'tablesorter-scroller-scrollbar-hack',
55
- scrollerReset : 'tablesorter-scroller-reset',
56
- // class name on table cannot start with 'tablesorter-' or the
57
- // suffix "scroller-rtl" will match as a theme name
58
- scrollerRtl : 'ts-scroller-rtl'
59
- });
60
-
61
- ts.addWidget({
62
- id : 'scroller',
63
- priority : 60, // run after the filter widget
64
- options : {
65
- scroller_height : 300,
66
- // pop table header into view while scrolling up the page
67
- scroller_jumpToHeader : true,
68
- // scroll tbody to top after sorting
69
- scroller_upAfterSort : true,
70
- // set number of fixed columns
71
- scroller_fixedColumns : 0,
72
- // add hover highlighting to the fixed column (disable if it causes slowing)
73
- scroller_rowHighlight : 'hover',
74
- // add a fixed column overlay for styling
75
- scroller_addFixedOverlay : false,
76
- // In tablesorter v2.19.0 the scroll bar width is auto-detected
77
- // add a value here to override the auto-detected setting
78
- scroller_barWidth : null
79
- },
80
- format : function( table, c, wo ) {
81
- if ( !c.isScrolling ) {
82
- // initialize here instead of in widget init to give the
83
- // filter widget time to finish building the filter row
84
- ts.scroller.setup( c, wo );
85
- }
86
- },
87
- remove : function( table, c, wo ) {
88
- ts.scroller.remove( c, wo );
89
- }
90
- });
91
-
92
- /* Add window resizeEnd event */
93
- ts.window_resize = function() {
94
- if ( ts.timer_resize ) {
95
- clearTimeout( ts.timer_resize );
96
- }
97
- ts.timer_resize = setTimeout( function() {
98
- $( window ).trigger( 'resizeEnd' );
99
- }, 250 );
100
- };
101
-
102
- // Add extra scroller css
103
- $( function() {
104
- var style = '<style>' +
105
- /* reset width to get accurate measurements after window resize */
106
- '.' + tscss.scrollerReset + ' { width: auto !important; min-width: auto !important; max-width: auto !important; }' +
107
- /* overall wrapper & table section wrappers */
108
- '.' + tscss.scrollerWrap + ' { position: relative; overflow: hidden; }' +
109
- /* add border-box sizing to all scroller widget tables; see #135 */
110
- '.' + tscss.scrollerWrap + ' * { box-sizing: border-box; }' +
111
- '.' + tscss.scrollerHeader + ', .' + tscss.scrollerFooter + ' { position: relative; overflow: hidden; }' +
112
- '.' + tscss.scrollerHeader + ' table.' + tscss.table + ' { margin-bottom: 0; }' +
113
- /* always leave the scroll bar visible for tbody, or table overflows into the scrollbar
114
- when height < max height (filtering) */
115
- '.' + tscss.scrollerTable + ' { position: relative; overflow: auto; }' +
116
- '.' + tscss.scrollerTable + ' table.' + tscss.table +
117
- ' { border-top: 0; margin-top: 0; margin-bottom: 0; overflow: hidden; }' +
118
- /* hide footer in original table */
119
- '.' + tscss.scrollerTable + ' tfoot, .' + tscss.scrollerHideElement + ', .' + tscss.scrollerHideColumn +
120
- ' { display: none; }' +
121
-
122
- /*** fixed column ***/
123
- /* disable pointer-events on fixed column wrapper or the user can't interact with the horizontal scrollbar */
124
- '.' + tscss.scrollerFixed + ', .' + tscss.scrollerFixed + ' .' + tscss.scrollerFixedPanel +
125
- ' { pointer-events: none; }' +
126
- /* enable pointer-events for fixed column children; see #135 & #878 */
127
- '.' + tscss.scrollerFixed + ' > div { pointer-events: all; }' +
128
- '.' + tscss.scrollerWrap + ' .' + tscss.scrollerFixed + ' { position: absolute; top: 0; z-index: 1; left: 0 } ' +
129
- '.' + tscss.scrollerWrap + ' .' + tscss.scrollerFixed + '.' + tscss.scrollerRtl + ' { left: auto; right: 0 } ' +
130
- /* add horizontal scroll bar; set to "auto", see #135 */
131
- '.' + tscss.scrollerWrap + '.' + tscss.scrollerHasFix + ' > .' + tscss.scrollerTable + ' { overflow: auto; }' +
132
- /* need to position the tbody & tfoot absolutely to hide the scrollbar & move the footer
133
- below the horizontal scrollbar */
134
- '.' + tscss.scrollerFixed + ' .' + tscss.scrollerFooter + ' { position: absolute; bottom: 0; }' +
135
- /* hide fixed tbody scrollbar - see http://goo.gl/VsLe6n */
136
- '.' + tscss.scrollerFixed + ' .' + tscss.scrollerTable +
137
- ' { position: relative; left: 0; overflow: hidden; -ms-overflow-style: none; }' +
138
- '.' + tscss.scrollerFixed + ' .' + tscss.scrollerTable + '::-webkit-scrollbar { display: none; }' +
139
- /*** fixed column panel ***/
140
- '.' + tscss.scrollerWrap + ' .' + tscss.scrollerFixedPanel +
141
- ' { position: absolute; top: 0; bottom: 0; z-index: 2; left: 0; right: 0; } ' +
142
- '</style>';
143
- $( style ).appendTo( 'body' );
144
- });
145
-
146
- ts.scroller = {
147
-
148
- // Ugh.. Firefox misbehaves, so it needs to be detected
149
- isFirefox : navigator.userAgent.toLowerCase().indexOf( 'firefox' ) > -1,
150
- // old IE needs a wrap to hide the fixed column scrollbar; http://stackoverflow.com/a/24408672/145346
151
- isOldIE : document.all && !window.atob,
152
- // http://stackoverflow.com/questions/7944460/detect-safari-browser - needed to position scrolling body
153
- // when the table is set up in RTL direction
154
- isSafari : navigator.userAgent.toLowerCase().indexOf( 'safari' ) > -1 &&
155
- navigator.userAgent.toLowerCase().indexOf( 'chrome' ) === -1,
156
-
157
- hasScrollBar : function( $target, checkWidth ) {
158
- if ( checkWidth ) {
159
- return $target.get(0).scrollWidth > $target.width();
160
- } else {
161
- return $target.get(0).scrollHeight > $target.height();
162
- }
163
- },
164
-
165
- setWidth : function( $el, width ) {
166
- $el.css({
167
- 'width' : width,
168
- 'min-width' : width,
169
- 'max-width' : width
170
- });
171
- },
172
-
173
- // modified from http://davidwalsh.name/detect-scrollbar-width
174
- getBarWidth : function() {
175
- var $div = $( '<div>' ).css({
176
- 'position' : 'absolute',
177
- 'top' : '-9999px',
178
- 'left' : 0,
179
- 'width' : '100px',
180
- 'height' : '100px',
181
- 'overflow' : 'scroll',
182
- 'visibility' : 'hidden'
183
- }).appendTo( 'body' ),
184
- div = $div[0],
185
- barWidth = div.offsetWidth - div.clientWidth;
186
- $div.remove();
187
- return barWidth;
188
- },
189
-
190
- setup : function( c, wo ) {
191
- var maxHt, tbHt, $hdr, $t, $hCells, $fCells, $tableWrap, tmp,
192
- $win = $( window ),
193
- namespace = c.namespace + 'tsscroller',
194
- $foot = $(),
195
- // c.namespace contains a unique tablesorter ID, per table
196
- id = c.namespace.slice( 1 ) + 'tsscroller',
197
- $table = c.$table;
198
-
199
- // set scrollbar width & allow setting width to zero
200
- wo.scroller_barSetWidth = wo.scroller_barWidth !== null ?
201
- wo.scroller_barWidth :
202
- ( ts.scroller.getBarWidth() || 15 );
203
-
204
- maxHt = wo.scroller_height || 300;
205
- // sum all tbody heights
206
- tbHt = 0;
207
- $table.children( 'tbody' ).map( function() {
208
- tbHt += $( this ).outerHeight();
209
- });
210
-
211
- $hdr = $( '<table class="' + $table.attr( 'class' ) + '" cellpadding=0 cellspacing=0>' +
212
- $table.children( 'thead' )[ 0 ].outerHTML + '</table>' );
213
- wo.scroller_$header = $hdr.addClass( c.namespace.slice( 1 ) + '_extra_table' );
214
-
215
- $t = $table.children( 'tfoot' );
216
- if ( $t.length ) {
217
- $foot = $( '<table class="' + $table.attr( 'class' ) +
218
- '" cellpadding=0 cellspacing=0 style="margin-top:0"></table>' )
219
- .addClass( c.namespace.slice( 1 ) + '_extra_table' )
220
- // maintain any bindings on the tfoot cells
221
- .append( $t.clone( true ) )
222
- .wrap( '<div class="' + tscss.scrollerFooter + '"/>' );
223
- $fCells = $foot.children( 'tfoot' ).eq( 0 ).children( 'tr' ).children();
224
- }
225
- wo.scroller_$footer = $foot;
226
-
227
- $table
228
- .wrap( '<div id="' + id + '" class="' + tscss.scrollerWrap + '" />' )
229
- .before( $hdr )
230
- // shrink filter row but don't completely hide it because the inputs/selectors may distort the columns
231
- .find( '.' + tscss.filterRow )
232
- .addClass( tscss.filterRowHide );
233
-
234
- wo.scroller_$container = $table.parent();
235
-
236
- if ( $foot.length ) {
237
- // $foot.parent() to include <div> wrapper
238
- $table.after( $foot.parent() );
239
- }
240
-
241
- $hCells = $hdr
242
- .wrap( '<div class="' + tscss.scrollerHeader + '" />' )
243
- .find( '.' + tscss.header );
244
-
245
- // use max-height, so the height resizes dynamically while filtering
246
- $table.wrap( '<div class="' + tscss.scrollerTable + '" style="max-height:' + maxHt + 'px;" />' );
247
- $tableWrap = $table.parent();
248
-
249
- // make scroller header sortable
250
- ts.bindEvents( c.table, $hCells );
251
-
252
- // look for filter widget
253
- if ( $table.hasClass( 'hasFilters' ) ) {
254
- ts.filter.bindSearch( $table, $hdr.find( '.' + tscss.filter ) );
255
- }
256
-
257
- $table
258
- .find( 'thead' )
259
- .addClass( tscss.scrollerHideElement );
260
-
261
- tbHt = $tableWrap.parent().height();
262
-
263
- // The header will always jump into view if scrolling the table body
264
- $tableWrap
265
- .off( 'scroll' + namespace )
266
- .on( 'scroll' + namespace, function() {
267
- if ( wo.scroller_jumpToHeader ) {
268
- var pos = $win.scrollTop() - $hdr.offset().top;
269
- if ( $( this ).scrollTop() !== 0 && pos < tbHt && pos > 0 ) {
270
- $win.scrollTop( $hdr.offset().top );
271
- }
272
- }
273
- $hdr
274
- .parent()
275
- .add( $foot.parent() )
276
- .scrollLeft( $( this ).scrollLeft() );
277
- });
278
-
279
- // Sorting, so scroll to top
280
- tmp = 'sortEnd setFixedColumnSize updateComplete pagerComplete pagerInitialized columnUpdate '
281
- .split( ' ' )
282
- .join( namespace + ' ' );
283
- $table
284
- .off( tmp )
285
- .on( 'sortEnd' + namespace, function() {
286
- if ( wo.scroller_upAfterSort ) {
287
- $table.parent().animate({
288
- scrollTop : 0
289
- }, 'fast' );
290
- }
291
- })
292
- .on( 'setFixedColumnSize' + namespace, function( event, size ) {
293
- var $wrap = wo.scroller_$container;
294
- if ( typeof size !== 'undefined' && !isNaN( size ) ) {
295
- wo.scroller_fixedColumns = parseInt( size, 10 );
296
- }
297
- // remove fixed columns
298
- ts.scroller.removeFixed( c, wo );
299
- size = wo.scroller_fixedColumns;
300
- if ( size > 0 && size < c.columns - 1 ) {
301
- ts.scroller.updateFixed( c, wo );
302
- } else if ( $wrap.hasClass( tscss.scrollerHasFix ) ) {
303
- $wrap.removeClass( tscss.scrollerHasFix );
304
- // resize needed to make tables full width
305
- ts.scroller.resize( c, wo );
306
- }
307
- })
308
- .on( 'updateComplete pagerComplete pagerInitialized columnUpdate '
309
- .split( ' ' ).join( namespace + ' ' ), function() {
310
- // adjust column sizes after an update
311
- ts.scroller.resize( c, wo );
312
- });
313
-
314
- // Setup window.resizeEnd event
315
- $win
316
- .off( 'resize resizeEnd '.split( ' ' ).join( namespace + ' ' ) )
317
- .on( 'resize' + namespace, ts.window_resize )
318
- .on( 'resizeEnd' + namespace, function() {
319
- // IE calls resize when you modify content, so we have to unbind the resize event
320
- // so we don't end up with an infinite loop. we can rebind after we're done.
321
- $win.off( 'resize' + namespace, ts.window_resize );
322
- ts.scroller.resize( c, wo );
323
- $win.on( 'resize' + namespace, ts.window_resize );
324
- $tableWrap.trigger( 'scroll' + namespace );
325
- });
326
-
327
- // initialization flag
328
- c.isScrolling = true;
329
-
330
- ts.scroller.updateFixed( c, wo );
331
-
332
- },
333
-
334
- resize : function( c, wo ) {
335
- var index, borderWidth, setWidth, $hCells, $bCells, $fCells, $headers, $this, temp,
336
- $table = c.$table,
337
- $tableWrap = $table.parent(),
338
- $hdr = wo.scroller_$header,
339
- $foot = wo.scroller_$footer,
340
- id = c.namespace.slice( 1 ) + 'tsscroller',
341
- // Hide other scrollers so we can resize
342
- $div = $( 'div.' + tscss.scrollerWrap + '[id!="' + id + '"]' )
343
- .addClass( tscss.scrollerHideElement );
344
-
345
- // Remove fixed so we get proper widths and heights
346
- ts.scroller.removeFixed( c, wo );
347
-
348
- // show original table thead to get proper alignments
349
- $table.children( 'thead' ).removeClass( tscss.scrollerHideElement );
350
-
351
- // Reset sizes so parent can resize.
352
- $table
353
- .addClass( tscss.scrollerReset )
354
- .children( 'thead' )
355
- .find( '.' + tscss.headerIn )
356
- .addClass( tscss.scrollerReset )
357
- .end()
358
- .find( '.' + tscss.filterRow )
359
- .removeClass( tscss.scrollerHideElement );
360
- $tableWrap.addClass( tscss.scrollerReset );
361
-
362
- // include left & right border widths
363
- borderWidth = parseInt( $table.css( 'border-left-width' ), 10 );
364
-
365
- $hCells = $hdr
366
- .children( 'thead' )
367
- .children( 'tr' )
368
- .not( '.' + c.cssIgnoreRow )
369
- .children( 'th, td' )
370
- .filter( ':visible' );
371
- $bCells = c.$tbodies
372
- .eq( 0 )
373
- .children( 'tr' )
374
- .not( '.' + c.cssChildRow )
375
- .eq( 0 )
376
- .children( 'th, td' )
377
- .filter( ':visible' );
378
- $fCells = $foot
379
- .children( 'tfoot' )
380
- .children( 'tr' )
381
- .children( 'th, td' )
382
- .filter( ':visible' );
383
-
384
- ts.scroller.setWidth( $hCells.add( $bCells ).add( $fCells ), '' );
385
- $headers = $table
386
- .children( 'thead' )
387
- .children()
388
- .eq( 0 )
389
- .children( 'th, td' );
390
- for ( index = 0; index < $headers.length; index++ ) {
391
- $this = $headers.eq( index );
392
- // code from https://github.com/jmosbech/StickyTableHeaders
393
- if ( $this.css( 'box-sizing' ) === 'border-box' ) {
394
- setWidth = $this.outerWidth();
395
- } else {
396
- if ( $hCells.eq( index ).css( 'border-collapse' ) === 'collapse' ) {
397
- if ( $this.length && window.getComputedStyle ) {
398
- setWidth = parseFloat( window.getComputedStyle( $this[ 0 ], null ).width );
399
- } else {
400
- // ie8 only
401
- setWidth = $this.outerWidth() - parseFloat( $this.css( 'padding-left' ) ) -
402
- parseFloat( $this.css( 'padding-right' ) ) -
403
- ( parseFloat( $this.css( 'border-width' ) ) || 0 );
404
- }
405
- } else {
406
- setWidth = $this.width();
407
- }
408
- }
409
- temp = $hCells.eq( index )
410
- .add( $bCells.eq( index ) )
411
- .add( $fCells.eq( index ) );
412
- ts.scroller.setWidth( temp, setWidth );
413
- }
414
-
415
- temp = $tableWrap.parent().innerWidth() -
416
- ( ts.scroller.hasScrollBar( $tableWrap ) ? wo.scroller_barSetWidth : 0 );
417
- $tableWrap.width( temp );
418
- setWidth = $tableWrap.innerWidth() -
419
- ( ts.scroller.hasScrollBar( $tableWrap ) ? wo.scroller_barSetWidth : 0 ) + borderWidth;
420
-
421
- $hdr
422
- .parent()
423
- .add( $foot.parent() )
424
- .width( setWidth );
425
-
426
- wo.scroller_$container
427
- .find( '.' + tscss.scrollerReset )
428
- .removeClass( tscss.scrollerReset );
429
-
430
- // update fixed column sizes
431
- ts.scroller.updateFixed( c, wo );
432
-
433
- // hide original table thead
434
- $table.children( 'thead' ).addClass( tscss.scrollerHideElement );
435
-
436
- $div.removeClass( tscss.scrollerHideElement );
437
-
438
- },
439
-
440
- // Add fixed (frozen) columns (Do not call directly, use updateFixed)
441
- setupFixed : function( c, wo ) {
442
- var index, index2, $el, len, temp, $fixedColumn, $fixedTbody, $fixedContainer,
443
- $table = c.$table,
444
- $wrapper = wo.scroller_$container,
445
- fixedColumns = wo.scroller_fixedColumns;
446
-
447
- $fixedColumn = $wrapper
448
- .addClass( tscss.scrollerHasFix )
449
- .clone()
450
- .addClass( tscss.scrollerFixed )
451
- .removeClass( tscss.scrollerWrap )
452
- .attr( 'id', '' );
453
-
454
- if ( wo.scroller_addFixedOverlay ) {
455
- $fixedColumn.append( '<div class="' + tscss.scrollerFixedPanel + '">' );
456
- }
457
-
458
- $fixedTbody = $fixedColumn.find( '.' + tscss.scrollerTable );
459
- $fixedContainer = $fixedTbody.children( 'table' ).children( 'tbody' );
460
- $fixedTbody
461
- .children( 'table' )
462
- .addClass( c.namespace.slice( 1 ) + '_extra_table' )
463
- .attr( 'id', '' )
464
- .children( 'thead, tfoot' )
465
- .remove();
466
-
467
- wo.scroller_$fixedColumns = $fixedColumn;
468
-
469
- // RTL support (fixes column on right)
470
- if ( $table.hasClass( tscss.scrollerRtl ) ) {
471
- $fixedColumn.addClass( tscss.scrollerRtl );
472
- }
473
-
474
- $el = $fixedColumn.find( 'tr' );
475
- len = $el.length;
476
- for ( index = 0; index < len; index++ ) {
477
- $el.eq( index ).children( ':gt(' + ( fixedColumns - 1 ) + ')' ).remove();
478
- }
479
- $fixedColumn
480
- .addClass( tscss.scrollerHideElement )
481
- .prependTo( $wrapper );
482
-
483
- // look for filter widget
484
- if ( c.$table.hasClass( 'hasFilters' ) ) {
485
- // make sure fixed column filters aren't disabled
486
- $el = $fixedColumn
487
- .find( '.' + tscss.filter )
488
- .not( '.' + tscss.filterDisabled )
489
- .prop( 'disabled', false );
490
- ts.filter.bindSearch( $table, $fixedColumn.find( '.' + tscss.filter ) );
491
- // disable/enable filters behind fixed column
492
- $el = $wrapper
493
- .children( '.' + tscss.scrollerHeader )
494
- .find( '.' + tscss.filter );
495
- len = $el.length;
496
- for ( index = 0; index < len; index++ ) {
497
- // previously disabled filter; don't mess with it! filterDisabled class added by filter widget
498
- if ( !$el.eq( index ).hasClass( tscss.filterDisabled || 'disabled' ) ) {
499
- // disable filters behind fixed column; don't disable visible filters
500
- $el.eq( index ).prop( 'disabled', index < fixedColumns );
501
- }
502
- }
503
- }
504
-
505
- // disable/enable tab indexes behind fixed column
506
- c.$table
507
- .add( '.' + tscss.scrollerFooter + ' table' )
508
- .children( 'thead' )
509
- .children( 'tr.' + tscss.headerRow )
510
- .children()
511
- .attr( 'tabindex', -1 );
512
-
513
- $el = wo.scroller_$header
514
- .add( $fixedColumn.find( '.' + tscss.scrollerTable + ' table' ) )
515
- .children( 'thead' )
516
- .children( 'tr.' + tscss.headerRow );
517
- len = $el.length;
518
- for ( index = 0; index < len; index++ ) {
519
- temp = $el.eq( index ).children();
520
- for ( index2 = 0; index2 < temp.length; index2++ ) {
521
- temp.eq( index2 ).attr( 'tabindex', index2 < fixedColumns ? -1 : 0 );
522
- }
523
- }
524
-
525
- ts.bindEvents( c.table, $fixedColumn.find( '.' + tscss.header ) );
526
- ts.scroller.bindFixedColumnEvents( c, wo );
527
-
528
- /*** Scrollbar hack! Since we can't hide the scrollbar with css ***/
529
- if ( ts.scroller.isFirefox || ts.scroller.isOldIE ) {
530
- $fixedTbody.wrap( '<div class="' + tscss.scrollerHack + '" style="overflow:hidden;">' );
531
- }
532
-
533
- },
534
-
535
- bindFixedColumnEvents : function( c, wo ) {
536
- // update thead & tbody in fixed column
537
- var namespace = c.namespace + 'tsscrollerFixed',
538
- events = ( 'tablesorter-initialized sortEnd filterEnd ' ).split( ' ' ).join( namespace + ' ' ),
539
- events2 = 'scroll' + namespace,
540
- $fixedTbody = wo.scroller_$fixedColumns.find( '.' + tscss.scrollerTable ),
541
- fixedScroll = true,
542
- tableScroll = true;
543
-
544
- c.$table
545
- .off( events )
546
- .on( events, function() {
547
- ts.scroller.updateFixed( c, wo, false );
548
- ts.scroller.resize( c, wo );
549
- })
550
- .parent()
551
- // *** SCROLL *** scroll fixed column along with main
552
- .off( events2 )
553
- .on( events2, function() {
554
- // using flags to prevent firing the scroll event excessively leading to slow scrolling in Firefox
555
- if ( fixedScroll || !ts.scroller.isFirefox ) {
556
- tableScroll = false;
557
- $fixedTbody[0].scrollTop = $( this ).scrollTop();
558
- setTimeout( function() {
559
- tableScroll = true;
560
- }, 20 );
561
- }
562
- });
563
- // scroll main along with fixed column
564
- $fixedTbody
565
- .off( events2 )
566
- .on( events2, function() {
567
- // using flags to prevent firing the scroll event excessively leading to slow scrolling in Firefox
568
- if ( tableScroll || !ts.scroller.isFirefox ) {
569
- fixedScroll = false;
570
- c.$table.parent()[0].scrollTop = $( this ).scrollTop();
571
- setTimeout( function() {
572
- fixedScroll = true;
573
- }, 20 );
574
- }
575
- })
576
- .scroll();
577
-
578
- // *** ROW HIGHLIGHT ***
579
- if ( wo.scroller_rowHighlight !== '' ) {
580
- events = 'mouseover mouseleave '.split( ' ' ).join( namespace + ' ' );
581
- // can't use c.$tbodies because it doesn't include info-only tbodies
582
- c.$table
583
- .off( events, 'tbody > tr' )
584
- .on( events, 'tbody > tr', function( event ) {
585
- var indx = c.$table.children( 'tbody' ).children( 'tr' ).index( this );
586
- $fixedTbody
587
- .children( 'table' )
588
- .children( 'tbody' )
589
- .children( 'tr' )
590
- .eq( indx )
591
- .add( this )
592
- .toggleClass( wo.scroller_rowHighlight, event.type === 'mouseover' );
593
- });
594
- $fixedTbody
595
- .find( 'table' )
596
- .off( events, 'tbody > tr' )
597
- .on( events, 'tbody > tr', function( event ) {
598
- var $fixed = $fixedTbody.children( 'table' ).children( 'tbody' ).children( 'tr' ),
599
- indx = $fixed.index( this );
600
- c.$table
601
- .children( 'tbody' )
602
- .children( 'tr' )
603
- .eq( indx )
604
- .add( this )
605
- .toggleClass( wo.scroller_rowHighlight, event.type === 'mouseover' );
606
- });
607
- }
608
- },
609
-
610
- updateFixed : function( c, wo ) {
611
- var $wrapper = wo.scroller_$container;
612
-
613
- if ( wo.scroller_fixedColumns === 0 ) {
614
- ts.scroller.removeFixed( c, wo );
615
- return;
616
- }
617
-
618
- if ( !c.isScrolling ) {
619
- return;
620
- }
621
-
622
- // Make sure the wo.scroller_$fixedColumns container exists if not build it
623
- if ( !$wrapper.find( '.' + tscss.scrollerFixed ).length ) {
624
- ts.scroller.setupFixed( c, wo );
625
- }
626
-
627
- // scroller_fixedColumns
628
- var index, tbodyIndex, rowIndex, $tbody, $adjCol, $fb, $fixHead, $fixBody, $fixFoot,
629
- totalRows, widths, temp, adj, row,
630
- $table = c.$table,
631
- $tableWrap = $table.parent(),
632
- $hdr = wo.scroller_$header,
633
- $foot = wo.scroller_$footer,
634
-
635
- // source cells for measurement
636
- $mainTbodies = wo.scroller_$container
637
- .children( '.' + tscss.scrollerTable )
638
- .children( 'table' )
639
- .children( 'tbody' ),
640
- // variable gets redefined
641
- $rows = wo.scroller_$header
642
- .children( 'thead' )
643
- .children( '.' + tscss.headerRow ),
644
-
645
- // hide fixed column during resize, or we get a FOUC
646
- $fixedColumn = wo.scroller_$fixedColumns
647
- .addClass( tscss.scrollerHideElement ),
648
-
649
- // target cells
650
- $fixedTbodiesTable = $fixedColumn
651
- .find( '.' + tscss.scrollerTable )
652
- .children( 'table' ),
653
- $fixedTbodies = $fixedTbodiesTable
654
- .children( 'tbody' ),
655
- // variables
656
- tsScroller = ts.scroller,
657
- scrollBarWidth = wo.scroller_barSetWidth,
658
- fixedColumns = wo.scroller_fixedColumns,
659
- dir = $table.hasClass( tscss.scrollerRtl ),
660
- // get dimensions
661
- $temp = $table.find( 'tbody td' ),
662
- borderRightWidth = parseInt( $temp.css( 'border-right-width' ), 10 ) || 1,
663
- borderSpacing = parseInt( ( $temp.css( 'border-spacing' ) || '' ).split( /\s/ )[ 0 ], 10 ) / 2 || 0,
664
- totalWidth = parseInt( $table.css( 'padding-left' ), 10 ) +
665
- parseInt( $table.css( 'padding-right' ), 10 ) -
666
- borderRightWidth;
667
-
668
- ts.scroller.removeFixed( c, wo, false );
669
-
670
- // recalculate widths
671
- $table.children( 'thead' ).removeClass( tscss.scrollerHideElement );
672
- widths = [];
673
- for ( index = 0; index < c.columns; index++ ) {
674
- temp = c.$headerIndexed[ index ].outerWidth();
675
- totalWidth += index < fixedColumns ? temp + borderSpacing : 0;
676
- widths.push( temp );
677
- }
678
- $table.children( 'thead' ).addClass( tscss.scrollerHideElement );
679
-
680
- // set fixed column width
681
- totalWidth = totalWidth + borderRightWidth * 2 - borderSpacing;
682
- tsScroller.setWidth( $fixedColumn.add( $fixedColumn.children() ), totalWidth );
683
- tsScroller.setWidth( $fixedColumn.children().children( 'table' ), totalWidth );
684
-
685
- $table.find( '.' + tscss.scrollerSpacerRow ).remove();
686
- row = '<tr class="' + tscss.scrollerSpacerRow + ' ' + c.selectorRemove.slice(1) + '">';
687
- for ( index = 0; index < c.columns; index++ ) {
688
- row += '<td style="padding:0; margin:0;height:0;max-height:0;min-height:0;width:' +
689
- widths[ index ] + 'px;min-width:' + widths[ index ] + 'px;max-width:' +
690
- widths[ index ] + 'px"></td>';
691
- }
692
- c.$tbodies.eq(0).prepend( row += '</tr>' );
693
-
694
- // update fixed column tbody content, set row height & set cell widths for first row
695
- for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
696
- $tbody = $mainTbodies.eq( tbodyIndex );
697
- if ( $tbody.length ) {
698
- // get tbody
699
- $rows = $tbody.children();
700
- totalRows = $rows.length;
701
- $fb = ts.processTbody( $fixedTbodiesTable, $fixedTbodies.eq( tbodyIndex ), true );
702
- $fb.empty();
703
- // update tbody cells after sort/filtering
704
- for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
705
- $adjCol = $( $rows[ rowIndex ].outerHTML );
706
- $adjCol
707
- .children( 'td, th' )
708
- .slice( fixedColumns )
709
- .remove();
710
- $fb.append( $adjCol );
711
- }
712
- // adjust fixed thead/tbody/tfoot cell widths
713
- $fixHead = $fixedColumn
714
- .find( 'thead' )
715
- .children( 'tr.' + tscss.headerRow )
716
- .children();
717
- $fixBody = $fixedColumn
718
- .find( tscss.scrollerSpacerRow )
719
- .children();
720
- $fixFoot = $fixedColumn
721
- .find( 'tfoot' )
722
- .children( 'tr' )
723
- .eq( 0 )
724
- .children();
725
- // reusing variables, so ignore the names :P
726
- $adjCol = $hdr.children( 'thead' ).children( 'tr' ).children( 'td, th' );
727
- $rows = $foot.children( 'tfoot' ).children( 'tr' ).children( 'td, th' );
728
- for ( index = 0; index < c.columns; index++ ) {
729
- if ( index < fixedColumns ) {
730
- $temp = $fixHead.eq( index )
731
- .add( $fixBody.eq( index ) )
732
- .add( $fixFoot.eq( index ) );
733
- tsScroller.setWidth( $temp, widths[ index ] );
734
- }
735
- $temp = $adjCol.eq( index )
736
- .add( $rows.eq( index ) );
737
- tsScroller.setWidth( $temp, widths[ index ] );
738
- }
739
-
740
- // restore tbody
741
- ts.processTbody( $fixedTbodiesTable, $fb, false );
742
- }
743
- }
744
-
745
- /*** scrollbar HACK! Since we can't hide the scrollbar with css ***/
746
- if ( tsScroller.isFirefox || tsScroller.isOldIE ) {
747
- $fixedTbodiesTable
748
- .parent()
749
- .css({
750
- 'width' : totalWidth
751
- });
752
- }
753
-
754
- $fixedColumn.removeClass( tscss.scrollerHideElement );
755
- for ( index = 0; index < fixedColumns; index++ ) {
756
- $wrapper
757
- .children( 'div' )
758
- .children( 'table' )
759
- .find( 'th:nth-child(' + ( index + 1 ) + '), td:nth-child(' + ( index + 1 ) + ')' )
760
- .addClass( tscss.scrollerHideColumn );
761
- }
762
-
763
- adj = ts.scroller.hasScrollBar( $tableWrap ) ? scrollBarWidth : 0;
764
- totalWidth = totalWidth - borderRightWidth;
765
- temp = $tableWrap.parent().innerWidth() - totalWidth;
766
- $tableWrap.width( temp );
767
- // RTL support (fixes column on right)
768
- $wrapper
769
- .children( '.' + tscss.scrollerTable )
770
- .css( dir ? 'right' : 'left', totalWidth );
771
- $wrapper
772
- .children( '.' + tscss.scrollerHeader + ', .' + tscss.scrollerFooter )
773
- // Safari needs a scrollbar width of extra adjusment to align the fixed & scrolling columns
774
- .css( dir ? 'right' : 'left', totalWidth + ( dir && ts.scroller.isSafari ? adj : 0 ) );
775
-
776
- $hdr
777
- .parent()
778
- .add( $foot.parent() )
779
- .width( temp - adj );
780
-
781
- // fix gap under the tbody for the horizontal scrollbar
782
- temp = ts.scroller.hasScrollBar( $tableWrap, true );
783
- adj = temp ? scrollBarWidth : 0;
784
- if ( !$fixedColumn.find( '.' + tscss.scrollerBarSpacer ).length && temp ) {
785
- $temp = $( '<div class="' + tscss.scrollerBarSpacer + '">' )
786
- .css( 'height', adj + 'px' );
787
- $fixedColumn.find( '.' + tscss.scrollerTable ).append( $temp );
788
- } else if ( !temp ) {
789
- $fixedColumn.find( '.' + tscss.scrollerBarSpacer ).remove();
790
- }
791
-
792
- ts.scroller.updateRowHeight( c, wo );
793
- // set fixed column height (changes with filtering)
794
- $fixedColumn.height( $wrapper.height() );
795
-
796
- $fixedColumn.removeClass( tscss.scrollerHideElement );
797
-
798
- },
799
-
800
- fixHeight : function( $rows, $fixedRows ) {
801
- var index, heightRow, heightFixed, $r, $f,
802
- len = $rows.length;
803
- for ( index = 0; index < len; index++ ) {
804
- $r = $rows.eq( index );
805
- $f = $fixedRows.eq( index );
806
- heightRow = $r.height();
807
- heightFixed = $f.height();
808
- if ( heightRow > heightFixed ) {
809
- $f.addClass( tscss.scrollerAddedHeight ).height( heightRow );
810
- } else if ( heightRow < heightFixed ) {
811
- $r.addClass( tscss.scrollerAddedHeight ).height( heightFixed );
812
- }
813
- }
814
- },
815
-
816
- updateRowHeight : function( c, wo ) {
817
- var $rows, $fixed,
818
- $fixedColumns = wo.scroller_$fixedColumns;
819
-
820
- wo.scroller_$container
821
- .find( '.' + tscss.scrollerAddedHeight )
822
- .removeClass( tscss.scrollerAddedHeight )
823
- .height( '' );
824
-
825
- $rows = wo.scroller_$header
826
- .children( 'thead' )
827
- .children( 'tr' );
828
- $fixed = $fixedColumns
829
- .children( '.' + tscss.scrollerHeader )
830
- .children( 'table' )
831
- .children( 'thead' )
832
- .children( 'tr' );
833
- ts.scroller.fixHeight( $rows, $fixed );
834
-
835
- $rows = wo.scroller_$footer
836
- .children( 'tfoot' )
837
- .children( 'tr' );
838
- $fixed = $fixedColumns
839
- .children( '.' + tscss.scrollerFooter )
840
- .children( 'table' )
841
- .children( 'tfoot' )
842
- .children( 'tr' );
843
- ts.scroller.fixHeight( $rows, $fixed );
844
-
845
- if ( ts.scroller.isFirefox ) {
846
- // Firefox/Old IE scrollbar hack (wraps table to hide the scrollbar)
847
- $fixedColumns = $fixedColumns.find( '.' + tscss.scrollerHack );
848
- }
849
- $rows = c.$table
850
- .children( 'tbody' )
851
- .children( 'tr' );
852
- $fixed = $fixedColumns
853
- .children( '.' + tscss.scrollerTable )
854
- .children( 'table' )
855
- .children( 'tbody' )
856
- .children( 'tr' );
857
- ts.scroller.fixHeight( $rows, $fixed );
858
-
859
- },
860
-
861
- removeFixed : function( c, wo, removeIt ) {
862
- var $table = c.$table,
863
- $wrapper = wo.scroller_$container,
864
- dir = $table.hasClass( tscss.scrollerRtl );
865
-
866
- // remove fixed columns
867
- if ( removeIt || typeof removeIt === 'undefined' ) {
868
- $wrapper.find( '.' + tscss.scrollerFixed ).remove();
869
- }
870
-
871
- $wrapper
872
- .find( '.' + tscss.scrollerHideColumn )
873
- .removeClass( tscss.scrollerHideColumn );
874
-
875
- // RTL support ( fixes column on right )
876
- $wrapper
877
- .children( ':not(.' + tscss.scrollerFixed + ')' )
878
- .css( dir ? 'right' : 'left', 0 );
879
- },
880
-
881
- remove : function( c, wo ) {
882
- var $wrap = wo.scroller_$container,
883
- namespace = c.namespace + 'tsscroller';
884
- c.$table
885
- .off( namespace )
886
- .insertBefore( $wrap )
887
- .find( 'thead' )
888
- .removeClass( tscss.scrollerHideElement )
889
- .children( 'tr.' + tscss.headerRow )
890
- .children()
891
- .attr( 'tabindex', 0 )
892
- .end()
893
- .find( '.' + tscss.filterRow )
894
- .removeClass( tscss.scrollerHideElement + ' ' + tscss.filterRowHide );
895
- c.$table
896
- .find( '.' + tscss.filter )
897
- .not( '.' + tscss.filterDisabled )
898
- .prop( 'disabled', false );
899
- $wrap.remove();
900
- $( window ).off( namespace );
901
- c.isScrolling = false;
902
- }
903
-
904
- };
905
-
906
- })( jQuery, window );