rapid-router 5.4.1__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.
- example_project/rapid_router_test_settings.py +164 -0
- example_project/settings.py +152 -0
- example_project/urls.py +15 -0
- example_project/{example_project/wsgi.py → wsgi.py} +2 -1
- game/__init__.py +1 -1
- game/admin.py +43 -4
- game/app_settings.py +3 -7
- game/character.py +26 -18
- game/decor.py +172 -97
- game/end_to_end_tests/base_game_test.py +44 -33
- game/end_to_end_tests/editor_page.py +17 -2
- game/end_to_end_tests/game_page.py +127 -45
- game/end_to_end_tests/selenium_test_case.py +1 -20
- game/end_to_end_tests/test_cow_crashes.py +3 -5
- game/end_to_end_tests/test_language_dropdown.py +14 -0
- game/end_to_end_tests/test_level_editor.py +290 -0
- game/end_to_end_tests/test_level_failures.py +1 -1
- game/end_to_end_tests/test_level_selection.py +79 -0
- game/end_to_end_tests/test_play_through.py +240 -102
- game/end_to_end_tests/test_python_levels.py +44 -13
- game/end_to_end_tests/test_saving_workspace.py +22 -0
- game/forms.py +9 -2
- game/level_management.py +38 -29
- game/messages.py +1218 -203
- game/migrations/0001_squashed_0025_levels_ordering_pt1.py +19 -1
- game/migrations/0026_levels_pt2.py +13 -2
- game/migrations/0032_cannot_turn_left_level.py +13 -2
- game/migrations/0033_recursion_level.py +13 -2
- game/migrations/0034_joes_level.py +13 -2
- game/migrations/0035_disable_route_score_level_70.py +0 -2
- game/migrations/0036_level_score_73.py +0 -2
- game/migrations/0037_level_score_79.py +0 -2
- game/migrations/0038_level_score_40.py +0 -1
- game/migrations/0042_level_score_73.py +0 -2
- game/migrations/0048_add_cow_field_and_blocks.py +0 -2
- game/migrations/0049_level_score_34.py +0 -2
- game/migrations/0050_level_score_40.py +0 -2
- game/migrations/0051_level_score_49.py +0 -1
- game/migrations/0076_level_locked_for_class.py +19 -0
- game/migrations/0077_alter_level_next_level.py +52 -0
- game/migrations/0078_add_block_types.py +23 -0
- game/migrations/0079_populate_block_type_add_cow_blocks.py +60 -0
- game/migrations/0080_level_disable_algorithm_score.py +18 -0
- game/migrations/0081_first_12_levels_no_algo_score.py +29 -0
- game/migrations/0082_level_43_solution.py +16 -0
- game/migrations/0083_add_cows_to_existing_levels.py +195 -0
- game/migrations/0084_alter_block_block_type.py +18 -0
- game/migrations/0085_add_new_blocks.py +53 -0
- game/migrations/0086_loop_levels.py +482 -0
- game/migrations/0087_workspace_python_view_enabled.py +18 -0
- game/migrations/0088_rename_episodes.py +35 -0
- game/migrations/0089_episodes_in_development.py +30 -0
- game/migrations/0090_add_missing_model_solutions.py +144 -0
- game/migrations/0091_disable_algo_score_if_no_model_solution.py +46 -0
- game/migrations/0092_disable_algo_score_in_custom_levels.py +28 -0
- game/migrations/0093_alter_level_character_name.py +18 -0
- game/migrations/0094_add_hint_lesson_subtitle_to_levels.py +28 -0
- game/migrations/0095_level_commands.py +18 -0
- game/migrations/0096_alter_level_commands.py +18 -0
- game/migrations/0097_add_python_den_levels.py +1515 -0
- game/migrations/0098_add_episode_link_fields.py +44 -0
- game/migrations/0099_python_episodes_links.py +103 -0
- game/migrations/0100_reorder_python_levels.py +179 -0
- game/migrations/0101_rename_episodes.py +45 -0
- game/migrations/0102_reoder_episodes_13_14.py +136 -0
- game/migrations/0103_level_1015_solution.py +26 -0
- game/migrations/0104_remove_level_direct_drive.py +17 -0
- game/migrations/0105_delete_invalid_attempts.py +18 -0
- game/migrations/0106_fields_to_snake_case.py +48 -0
- game/migrations/0107_rename_worksheet_link_episode_student_worksheet_link.py +18 -0
- game/migrations/0108_episode_indy_worksheet_link.py +18 -0
- game/migrations/0109_create_episodes_23_and_24.py +99 -0
- game/migrations/0110_remove_episode_indy_worksheet_link_and_more.py +100 -0
- game/migrations/0111_create_worksheets.py +149 -0
- game/migrations/0112_worksheet_locked_classes.py +21 -0
- game/migrations/0113_level_needs_approval.py +18 -0
- game/migrations/0114_default_and_non_student_levels_no_approval.py +31 -0
- game/migrations/0115_level_level__default_does_not_need_approval.py +22 -0
- game/migrations/0116_update_worksheet_video_links.py +68 -0
- game/migrations/0117_update_solutions_to_if_else.py +61 -0
- game/models.py +157 -16
- game/permissions.py +34 -19
- game/python_den_urls.py +26 -0
- game/random_road.py +43 -127
- game/serializers.py +12 -17
- game/static/django_reverse_js/js/reverse.js +171 -0
- game/static/game/css/LilitaOne-Regular.ttf +0 -0
- game/static/game/css/backgrounds.css +14 -10
- game/static/game/css/dataTables.custom.css +4 -2
- game/static/game/css/dataTables.jqueryui.css +561 -320
- game/static/game/css/editor.css +47 -0
- game/static/game/css/game.css +43 -49
- game/static/game/css/game_screen.css +116 -53
- game/static/game/css/jquery.dataTables.css +455 -251
- game/static/game/css/level_editor.css +10 -1
- game/static/game/css/level_selection.css +32 -3
- game/static/game/css/level_share.css +6 -5
- game/static/game/css/skulpt/codemirror.css +1 -0
- game/static/game/image/Python_Den_hero_student.png +0 -0
- game/static/game/image/Python_levels_page.svg +1954 -0
- game/static/game/image/characters/front_view/Electric_van.svg +448 -0
- game/static/game/image/characters/top_view/Electric_van.svg +448 -0
- game/static/game/image/characters/top_view/Sleigh.svg +436 -0
- game/static/game/image/decor/city/solar_panel.svg +1200 -0
- game/static/game/image/decor/farm/solar_panel.svg +86 -0
- game/static/game/image/decor/grass/solar_panel.svg +86 -0
- game/static/game/image/decor/snow/barn.svg +1788 -0
- game/static/game/image/decor/snow/cfc.svg +1050 -147
- game/static/game/image/decor/snow/crops.svg +7370 -0
- game/static/game/image/decor/snow/hospital.svg +1220 -0
- game/static/game/image/decor/snow/house1.svg +971 -0
- game/static/game/image/decor/snow/house2.svg +1574 -0
- game/static/game/image/decor/snow/school.svg +1071 -0
- game/static/game/image/decor/snow/shop.svg +3211 -0
- game/static/game/image/decor/snow/solar_panel.svg +173 -0
- game/static/game/image/electric_van.svg +448 -0
- game/static/game/image/icons/add_house.svg +26 -0
- game/static/game/image/icons/delete_house.svg +26 -0
- game/static/game/image/icons/description.svg +1 -0
- game/static/game/image/icons/hint.svg +1 -0
- game/static/game/image/icons/if_else.svg +3 -0
- game/static/game/image/icons/python.svg +1 -1
- game/static/game/image/if_else_example.png +0 -0
- game/static/game/image/pigeon.svg +684 -0
- game/static/game/image/python_den_header.svg +19 -0
- game/static/game/js/animation.js +84 -28
- game/static/game/js/blockly/msg/js/bg.js +52 -1
- game/static/game/js/blockly/msg/js/ca.js +52 -1
- game/static/game/js/blockly/msg/js/en-gb.js +52 -1
- game/static/game/js/blockly/msg/js/en.js +52 -1
- game/static/game/js/blockly/msg/js/es.js +52 -1
- game/static/game/js/blockly/msg/js/fr.js +52 -1
- game/static/game/js/blockly/msg/js/hi.js +52 -1
- game/static/game/js/blockly/msg/js/it.js +52 -1
- game/static/game/js/blockly/msg/js/pl.js +52 -1
- game/static/game/js/blockly/msg/js/pt-br.js +52 -1
- game/static/game/js/blockly/msg/js/ru.js +52 -1
- game/static/game/js/blockly/msg/js/ur.js +52 -1
- game/static/game/js/blocklyCompiler.js +550 -392
- game/static/game/js/blocklyControl.js +335 -302
- game/static/game/js/blocklyCustomBlocks.js +691 -458
- game/static/game/js/blocklyCustomisations.js +3 -1
- game/static/game/js/button.js +12 -0
- game/static/game/js/cow.js +15 -130
- game/static/game/js/drawing.js +313 -201
- game/static/game/js/editor.js +23 -0
- game/static/game/js/game.js +148 -139
- game/static/game/js/jquery.dataTables.min.js +3 -159
- game/static/game/js/level_editor.js +823 -448
- game/static/game/js/level_moderation.js +33 -2
- game/static/game/js/level_selection.js +62 -25
- game/static/game/js/loadLanguages.js +21 -0
- game/static/game/js/map.js +106 -36
- game/static/game/js/model.js +55 -107
- game/static/game/js/pathFinder.js +73 -72
- game/static/game/js/program.js +184 -193
- game/static/game/js/pythonControl.js +14 -1
- game/static/game/js/scoreboard.js +0 -37
- game/static/game/js/scoreboardSharedLevels.js +48 -0
- game/static/game/js/sharing.js +22 -10
- game/static/game/js/skulpt/codemirror.js +5 -4
- game/static/game/js/skulpt/skulpt-stdlib.js +1 -1
- game/static/game/js/sound.js +52 -5
- game/static/game/js/van.js +0 -7
- game/static/game/raphael_image/characters/top_view/Electric_van.svg +448 -0
- game/static/game/raphael_image/characters/top_view/Sleigh.svg +436 -0
- game/static/game/raphael_image/decor/city/solar_panel.svg +1200 -0
- game/static/game/raphael_image/decor/farm/solar_panel.svg +86 -0
- game/static/game/raphael_image/decor/grass/solar_panel.svg +86 -0
- game/static/game/raphael_image/decor/snow/barn.svg +1788 -0
- game/static/game/raphael_image/decor/snow/cfc.svg +1050 -147
- game/static/game/raphael_image/decor/snow/crops.svg +7370 -0
- game/static/game/raphael_image/decor/snow/hospital.svg +1220 -0
- game/static/game/raphael_image/decor/snow/house1.svg +971 -0
- game/static/game/raphael_image/decor/snow/house2.svg +1574 -0
- game/static/game/raphael_image/decor/snow/school.svg +1071 -0
- game/static/game/raphael_image/decor/snow/shop.svg +3211 -0
- game/static/game/raphael_image/decor/snow/solar_panel.svg +173 -0
- game/static/game/raphael_image/pigeon.svg +685 -0
- game/static/game/raphael_image/sleigh_wreckage.svg +430 -0
- game/static/game/sass/game.scss +22 -6
- game/static/game/sound/clown_horn.mp3 +0 -0
- game/static/game/sound/clown_horn.ogg +0 -0
- game/static/game/sound/electric_van_starting.mp3 +0 -0
- game/static/game/sound/electric_van_starting.ogg +0 -0
- game/static/game/sound/pigeon.mp3 +0 -0
- game/static/game/sound/pigeon.ogg +0 -0
- game/static/game/sound/sleigh_bells.mp3 +0 -0
- game/static/game/sound/sleigh_bells.ogg +0 -0
- game/static/game/sound/sleigh_crash.mp3 +0 -0
- game/static/game/sound/sleigh_crash.ogg +0 -0
- game/templates/game/base.html +35 -15
- game/templates/game/basenonav.html +23 -17
- game/templates/game/game.html +236 -111
- game/templates/game/level_editor.html +353 -275
- game/templates/game/level_moderation.html +19 -6
- game/templates/game/level_selection.html +75 -62
- game/templates/game/python_den_level_selection.html +291 -0
- game/templates/game/python_den_worksheet.html +101 -0
- game/templates/game/scoreboard.html +88 -65
- game/tests/test_level_editor.py +210 -35
- game/tests/test_level_moderation.py +6 -20
- game/tests/test_level_selection.py +332 -11
- game/tests/test_python_den_worksheet.py +85 -0
- game/tests/test_scoreboard.py +258 -66
- game/tests/utils/level.py +43 -3
- game/tests/utils/teacher.py +2 -2
- game/theme.py +21 -21
- game/urls.py +125 -78
- game/views/language_code_conversions.py +90 -0
- game/views/level.py +201 -63
- game/views/level_editor.py +109 -48
- game/views/level_moderation.py +29 -6
- game/views/level_selection.py +179 -56
- game/views/level_solutions.py +600 -106
- game/views/scoreboard.py +181 -66
- game/views/worksheet.py +25 -0
- rapid_router-7.6.8.dist-info/METADATA +174 -0
- {rapid_router-5.4.1.dist-info → rapid_router-7.6.8.dist-info}/RECORD +222 -242
- {rapid_router-5.4.1.dist-info → rapid_router-7.6.8.dist-info}/WHEEL +1 -1
- rapid_router-7.6.8.dist-info/licenses/LICENSE.md +3 -0
- example_project/example_project/__init__.py +0 -1
- example_project/example_project/settings.py +0 -54
- example_project/example_project/urls.py +0 -16
- example_project/manage.py +0 -10
- game/autoconfig.py +0 -59
- game/csp_config.py +0 -23
- game/locale/ar_SA/LC_MESSAGES/django.mo +0 -0
- game/locale/ar_SA/LC_MESSAGES/django.po +0 -405
- game/locale/ar_SA/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ar_SA/LC_MESSAGES/djangojs.po +0 -743
- game/locale/bg_BG/LC_MESSAGES/django.mo +0 -0
- game/locale/bg_BG/LC_MESSAGES/django.po +0 -405
- game/locale/bg_BG/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/bg_BG/LC_MESSAGES/djangojs.po +0 -739
- game/locale/ca_ES/LC_MESSAGES/django.mo +0 -0
- game/locale/ca_ES/LC_MESSAGES/django.po +0 -405
- game/locale/ca_ES/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ca_ES/LC_MESSAGES/djangojs.po +0 -740
- game/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
- game/locale/cs_CZ/LC_MESSAGES/django.po +0 -405
- game/locale/cs_CZ/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/cs_CZ/LC_MESSAGES/djangojs.po +0 -741
- game/locale/cy_GB/LC_MESSAGES/django.mo +0 -0
- game/locale/cy_GB/LC_MESSAGES/django.po +0 -405
- game/locale/cy_GB/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/cy_GB/LC_MESSAGES/djangojs.po +0 -743
- game/locale/de_DE/LC_MESSAGES/django.mo +0 -0
- game/locale/de_DE/LC_MESSAGES/django.po +0 -405
- game/locale/de_DE/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/de_DE/LC_MESSAGES/djangojs.po +0 -739
- game/locale/el_GR/LC_MESSAGES/django.mo +0 -0
- game/locale/el_GR/LC_MESSAGES/django.po +0 -405
- game/locale/el_GR/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/el_GR/LC_MESSAGES/djangojs.po +0 -739
- game/locale/en_GB/LC_MESSAGES/django.mo +0 -0
- game/locale/en_GB/LC_MESSAGES/django.po +0 -405
- game/locale/en_GB/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/en_GB/LC_MESSAGES/djangojs.po +0 -739
- game/locale/es_ES/LC_MESSAGES/django.mo +0 -0
- game/locale/es_ES/LC_MESSAGES/django.po +0 -405
- game/locale/es_ES/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/es_ES/LC_MESSAGES/djangojs.po +0 -739
- game/locale/fi_FI/LC_MESSAGES/django.mo +0 -0
- game/locale/fi_FI/LC_MESSAGES/django.po +0 -405
- game/locale/fi_FI/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/fi_FI/LC_MESSAGES/djangojs.po +0 -739
- game/locale/fr_FR/LC_MESSAGES/django.mo +0 -0
- game/locale/fr_FR/LC_MESSAGES/django.po +0 -405
- game/locale/fr_FR/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/fr_FR/LC_MESSAGES/djangojs.po +0 -739
- game/locale/gu_IN/LC_MESSAGES/django.mo +0 -0
- game/locale/gu_IN/LC_MESSAGES/django.po +0 -405
- game/locale/gu_IN/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/gu_IN/LC_MESSAGES/djangojs.po +0 -739
- game/locale/hi_IN/LC_MESSAGES/django.mo +0 -0
- game/locale/hi_IN/LC_MESSAGES/django.po +0 -405
- game/locale/hi_IN/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/hi_IN/LC_MESSAGES/djangojs.po +0 -739
- game/locale/id_ID/LC_MESSAGES/django.mo +0 -0
- game/locale/id_ID/LC_MESSAGES/django.po +0 -405
- game/locale/id_ID/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/id_ID/LC_MESSAGES/djangojs.po +0 -738
- game/locale/it_IT/LC_MESSAGES/django.mo +0 -0
- game/locale/it_IT/LC_MESSAGES/django.po +0 -405
- game/locale/it_IT/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/it_IT/LC_MESSAGES/djangojs.po +0 -739
- game/locale/ja_JP/LC_MESSAGES/django.mo +0 -0
- game/locale/ja_JP/LC_MESSAGES/django.po +0 -405
- game/locale/ja_JP/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ja_JP/LC_MESSAGES/djangojs.po +0 -738
- game/locale/lol_US/LC_MESSAGES/django.mo +0 -0
- game/locale/lol_US/LC_MESSAGES/django.po +0 -405
- game/locale/lol_US/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/lol_US/LC_MESSAGES/djangojs.po +0 -739
- game/locale/nb_NO/LC_MESSAGES/django.mo +0 -0
- game/locale/nb_NO/LC_MESSAGES/django.po +0 -405
- game/locale/nb_NO/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/nb_NO/LC_MESSAGES/djangojs.po +0 -739
- game/locale/nl_NL/LC_MESSAGES/django.mo +0 -0
- game/locale/nl_NL/LC_MESSAGES/django.po +0 -405
- game/locale/nl_NL/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/nl_NL/LC_MESSAGES/djangojs.po +0 -739
- game/locale/pl_PL/LC_MESSAGES/django.mo +0 -0
- game/locale/pl_PL/LC_MESSAGES/django.po +0 -405
- game/locale/pl_PL/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/pl_PL/LC_MESSAGES/djangojs.po +0 -741
- game/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
- game/locale/pt_BR/LC_MESSAGES/django.po +0 -405
- game/locale/pt_BR/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/pt_BR/LC_MESSAGES/djangojs.po +0 -739
- game/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
- game/locale/pt_PT/LC_MESSAGES/django.po +0 -405
- game/locale/pt_PT/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/pt_PT/LC_MESSAGES/djangojs.po +0 -739
- game/locale/ro_RO/LC_MESSAGES/django.mo +0 -0
- game/locale/ro_RO/LC_MESSAGES/django.po +0 -405
- game/locale/ro_RO/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ro_RO/LC_MESSAGES/djangojs.po +0 -740
- game/locale/ru_RU/LC_MESSAGES/django.mo +0 -0
- game/locale/ru_RU/LC_MESSAGES/django.po +0 -405
- game/locale/ru_RU/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ru_RU/LC_MESSAGES/djangojs.po +0 -741
- game/locale/sv_SE/LC_MESSAGES/django.mo +0 -0
- game/locale/sv_SE/LC_MESSAGES/django.po +0 -405
- game/locale/sv_SE/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/sv_SE/LC_MESSAGES/djangojs.po +0 -739
- game/locale/tl_PH/LC_MESSAGES/django.mo +0 -0
- game/locale/tl_PH/LC_MESSAGES/django.po +0 -405
- game/locale/tl_PH/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/tl_PH/LC_MESSAGES/djangojs.po +0 -739
- game/locale/tlh_AA/LC_MESSAGES/django.mo +0 -0
- game/locale/tlh_AA/LC_MESSAGES/django.po +0 -405
- game/locale/tlh_AA/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/tlh_AA/LC_MESSAGES/djangojs.po +0 -739
- game/locale/tr_TR/LC_MESSAGES/django.mo +0 -0
- game/locale/tr_TR/LC_MESSAGES/django.po +0 -405
- game/locale/tr_TR/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/tr_TR/LC_MESSAGES/djangojs.po +0 -740
- game/locale/ur_IN/LC_MESSAGES/django.mo +0 -0
- game/locale/ur_IN/LC_MESSAGES/django.po +0 -405
- game/locale/ur_IN/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ur_IN/LC_MESSAGES/djangojs.po +0 -739
- game/locale/ur_PK/LC_MESSAGES/django.mo +0 -0
- game/locale/ur_PK/LC_MESSAGES/django.po +0 -405
- game/locale/ur_PK/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ur_PK/LC_MESSAGES/djangojs.po +0 -739
- game/static/game/image/actions/go.svg +0 -18
- game/static/game/image/icons/destination.svg +0 -9
- game/static/game/js/pqselect.min.js +0 -9
- game/static/game/js/widget-scroller.js +0 -906
- rapid_router-5.4.1.dist-info/LICENSE.md +0 -577
- rapid_router-5.4.1.dist-info/METADATA +0 -24
- {rapid_router-5.4.1.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 );
|