ad2games-ui_components 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +28 -0
- data/app/assets/javascripts/ui_components.js.erb +26 -0
- data/app/assets/javascripts/ui_components/chosen_init.coffee +9 -0
- data/app/assets/javascripts/ui_components/domchange.coffee +1 -0
- data/app/assets/javascripts/ui_components/hide_empty_dropdowns.coffee +4 -0
- data/app/assets/javascripts/ui_components/modal.coffee +1 -0
- data/app/assets/javascripts/ui_components/navbar.coffee +2 -0
- data/app/assets/javascripts/ui_components/sticky_header.coffee +24 -0
- data/app/assets/javascripts/ui_components/submit_on_change.coffee +3 -0
- data/app/assets/javascripts/ui_components/turbolinks_progressbar.coffee +2 -0
- data/app/assets/stylesheets/a2g_ui_components.scss +8 -0
- data/app/assets/stylesheets/default_theme/button.scss +160 -0
- data/app/assets/stylesheets/default_theme/common.scss +15 -0
- data/app/assets/stylesheets/default_theme/footer.scss +7 -0
- data/app/assets/stylesheets/default_theme/form.scss +72 -0
- data/app/assets/stylesheets/default_theme/navbar.scss +55 -0
- data/app/assets/stylesheets/default_theme/table.scss +68 -0
- data/app/assets/stylesheets/default_theme/toolbar.scss +117 -0
- data/app/assets/stylesheets/libs.scss +6 -0
- data/app/assets/stylesheets/ui_components.scss.erb +15 -0
- data/app/assets/stylesheets/ui_components/checkbox_list.scss +11 -0
- data/app/assets/stylesheets/ui_components/date_range.scss +5 -0
- data/app/assets/stylesheets/ui_components/markdown_textarea.scss +7 -0
- data/app/assets/stylesheets/variables.scss +893 -0
- data/app/cells/checkbox_list/checkbox_list.yml +7 -0
- data/app/cells/checkbox_list/checkbox_list_cell.rb +33 -0
- data/app/cells/datagrid_filter/datagrid_filter.yml +14 -0
- data/app/cells/datagrid_filter/datagrid_filter_cell.rb +35 -0
- data/app/cells/date_range/date_range.coffee +69 -0
- data/app/cells/date_range/date_range.yml +7 -0
- data/app/cells/date_range/date_range_cell.rb +55 -0
- data/app/cells/form_cell_base.rb +26 -0
- data/app/cells/hello_world/hello_world.slim +1 -0
- data/app/cells/hello_world/hello_world.yml +5 -0
- data/app/cells/hello_world/hello_world_cell.rb +4 -0
- data/app/cells/markdown_readonly/markdown_readonly.coffee +5 -0
- data/app/cells/markdown_readonly/markdown_readonly.slim +1 -0
- data/app/cells/markdown_readonly/markdown_readonly.yml +4 -0
- data/app/cells/markdown_readonly/markdown_readonly_cell.rb +4 -0
- data/app/cells/markdown_textarea/markdown_textarea.coffee +9 -0
- data/app/cells/markdown_textarea/markdown_textarea.slim +9 -0
- data/app/cells/markdown_textarea/markdown_textarea.yml +8 -0
- data/app/cells/markdown_textarea/markdown_textarea_cell.rb +42 -0
- data/app/cells/modal/modal.coffee +2 -0
- data/app/cells/modal/modal.slim +12 -0
- data/app/cells/modal/modal.yml +22 -0
- data/app/cells/modal/modal_cell.rb +31 -0
- data/app/cells/select/select.coffee +35 -0
- data/app/cells/select/select.yml +14 -0
- data/app/cells/select/select_cell.rb +59 -0
- data/app/helpers/ui_components/view_helper.rb +8 -0
- data/lib/generators/generate_component.thor +32 -0
- data/lib/tasks/styleguide.rake +8 -0
- data/lib/ui_components.rb +14 -0
- data/lib/ui_components/cell.rb +16 -0
- data/lib/ui_components/cell_attributes.rb +49 -0
- data/lib/ui_components/docu_cop.rb +31 -0
- data/lib/ui_components/engine.rb +26 -0
- data/lib/ui_components/form_helper.rb +32 -0
- data/lib/ui_components/templates/cell.tt +2 -0
- data/lib/ui_components/templates/coffee.tt +0 -0
- data/lib/ui_components/templates/config.tt +9 -0
- data/lib/ui_components/templates/sass.tt +0 -0
- data/lib/ui_components/templates/view.tt +0 -0
- data/vendor/assets/bower_components/ajax-chosen/CHANGELOG.md +10 -0
- data/vendor/assets/bower_components/ajax-chosen/Cakefile +93 -0
- data/vendor/assets/bower_components/ajax-chosen/Makefile +2 -0
- data/vendor/assets/bower_components/ajax-chosen/README.md +131 -0
- data/vendor/assets/bower_components/ajax-chosen/VERSION +1 -0
- data/vendor/assets/bower_components/ajax-chosen/bower.json +23 -0
- data/vendor/assets/bower_components/ajax-chosen/data.json +57 -0
- data/vendor/assets/bower_components/ajax-chosen/docs/ajax-chosen.html +71 -0
- data/vendor/assets/bower_components/ajax-chosen/docs/docco.css +186 -0
- data/vendor/assets/bower_components/ajax-chosen/index.html +47 -0
- data/vendor/assets/bower_components/ajax-chosen/lib/ajax-chosen.js +159 -0
- data/vendor/assets/bower_components/ajax-chosen/lib/ajax-chosen.min.js +17 -0
- data/vendor/assets/bower_components/ajax-chosen/package.json +18 -0
- data/vendor/assets/bower_components/ajax-chosen/src/ajax-chosen.coffee +183 -0
- data/vendor/assets/bower_components/bootstrap-chosen/README.md +29 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen-variables.less +24 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen-variables.scss +16 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen.less +473 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen.scss +459 -0
- data/vendor/assets/bower_components/bootstrap-chosen/bower.json +25 -0
- data/vendor/assets/bower_components/bootstrap-chosen/chosen-sprite.png +0 -0
- data/vendor/assets/bower_components/bootstrap-chosen/chosen-sprite@2x.png +0 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/README.md +200 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/bower.json +20 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker-bs2.css +303 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker-bs3.css +335 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker.js +1348 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/examples.html +272 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/package.js +18 -0
- data/vendor/assets/bower_components/bootstrap-daterangepicker/package.json +32 -0
- data/vendor/assets/bower_components/chosen/bower.json +50 -0
- data/vendor/assets/bower_components/chosen/chosen-sprite.png +0 -0
- data/vendor/assets/bower_components/chosen/chosen-sprite@2x.png +0 -0
- data/vendor/assets/bower_components/chosen/chosen.css +448 -0
- data/vendor/assets/bower_components/chosen/chosen.jquery.js +1272 -0
- data/vendor/assets/bower_components/highlightjs/LICENSE +24 -0
- data/vendor/assets/bower_components/highlightjs/Makefile +21 -0
- data/vendor/assets/bower_components/highlightjs/README.md +12 -0
- data/vendor/assets/bower_components/highlightjs/bower.json +14 -0
- data/vendor/assets/bower_components/highlightjs/component.json +12 -0
- data/vendor/assets/bower_components/highlightjs/composer.json +26 -0
- data/vendor/assets/bower_components/highlightjs/highlight.pack.js +15263 -0
- data/vendor/assets/bower_components/highlightjs/highlight.pack.min.js +12 -0
- data/vendor/assets/bower_components/highlightjs/package.json +8 -0
- data/vendor/assets/bower_components/highlightjs/styles/agate.css +108 -0
- data/vendor/assets/bower_components/highlightjs/styles/androidstudio.css +66 -0
- data/vendor/assets/bower_components/highlightjs/styles/arduino-light.css +88 -0
- data/vendor/assets/bower_components/highlightjs/styles/arta.css +73 -0
- data/vendor/assets/bower_components/highlightjs/styles/ascetic.css +45 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-cave-dark.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-cave-light.css +85 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-cave.dark.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-cave.light.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-dune-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-dune-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-dune.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-dune.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary-dark.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary-light.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary.dark.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary.light.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-forest-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-forest-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-forest.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-forest.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-heath-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-heath-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-heath.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-heath.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau-dark.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau-light.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau.dark.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau.light.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna-dark.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna-light.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna.dark.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna.light.css +113 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool-dark.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool-light.css +69 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool.dark.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool.light.css +94 -0
- data/vendor/assets/bower_components/highlightjs/styles/brown-paper.css +64 -0
- data/vendor/assets/bower_components/highlightjs/styles/brown-papersq.png +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/brown_paper.css +103 -0
- data/vendor/assets/bower_components/highlightjs/styles/brown_papersq.png +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/codepen-embed.css +60 -0
- data/vendor/assets/bower_components/highlightjs/styles/color-brewer.css +71 -0
- data/vendor/assets/bower_components/highlightjs/styles/dark.css +63 -0
- data/vendor/assets/bower_components/highlightjs/styles/darkula.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/default.css +99 -0
- data/vendor/assets/bower_components/highlightjs/styles/docco.css +97 -0
- data/vendor/assets/bower_components/highlightjs/styles/dracula.css +76 -0
- data/vendor/assets/bower_components/highlightjs/styles/far.css +71 -0
- data/vendor/assets/bower_components/highlightjs/styles/foundation.css +88 -0
- data/vendor/assets/bower_components/highlightjs/styles/github-gist.css +71 -0
- data/vendor/assets/bower_components/highlightjs/styles/github.css +99 -0
- data/vendor/assets/bower_components/highlightjs/styles/googlecode.css +89 -0
- data/vendor/assets/bower_components/highlightjs/styles/grayscale.css +101 -0
- data/vendor/assets/bower_components/highlightjs/styles/gruvbox-dark.css +108 -0
- data/vendor/assets/bower_components/highlightjs/styles/gruvbox-light.css +108 -0
- data/vendor/assets/bower_components/highlightjs/styles/hopscotch.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/hybrid.css +102 -0
- data/vendor/assets/bower_components/highlightjs/styles/idea.css +97 -0
- data/vendor/assets/bower_components/highlightjs/styles/ir-black.css +73 -0
- data/vendor/assets/bower_components/highlightjs/styles/ir_black.css +106 -0
- data/vendor/assets/bower_components/highlightjs/styles/kimbie.dark.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/kimbie.light.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/magula.css +70 -0
- data/vendor/assets/bower_components/highlightjs/styles/mono-blue.css +59 -0
- data/vendor/assets/bower_components/highlightjs/styles/monokai-sublime.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/monokai.css +70 -0
- data/vendor/assets/bower_components/highlightjs/styles/monokai_sublime.css +154 -0
- data/vendor/assets/bower_components/highlightjs/styles/obsidian.css +88 -0
- data/vendor/assets/bower_components/highlightjs/styles/paraiso-dark.css +72 -0
- data/vendor/assets/bower_components/highlightjs/styles/paraiso-light.css +72 -0
- data/vendor/assets/bower_components/highlightjs/styles/paraiso.dark.css +96 -0
- data/vendor/assets/bower_components/highlightjs/styles/paraiso.light.css +96 -0
- data/vendor/assets/bower_components/highlightjs/styles/pojoaque.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/pojoaque.jpg +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/qtcreator_dark.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/qtcreator_light.css +83 -0
- data/vendor/assets/bower_components/highlightjs/styles/railscasts.css +106 -0
- data/vendor/assets/bower_components/highlightjs/styles/rainbow.css +85 -0
- data/vendor/assets/bower_components/highlightjs/styles/school-book.css +72 -0
- data/vendor/assets/bower_components/highlightjs/styles/school-book.png +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/school_book.css +111 -0
- data/vendor/assets/bower_components/highlightjs/styles/school_book.png +0 -0
- data/vendor/assets/bower_components/highlightjs/styles/solarized-dark.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/solarized-light.css +84 -0
- data/vendor/assets/bower_components/highlightjs/styles/solarized_dark.css +107 -0
- data/vendor/assets/bower_components/highlightjs/styles/solarized_light.css +107 -0
- data/vendor/assets/bower_components/highlightjs/styles/sunburst.css +102 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-blue.css +75 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-bright.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-eighties.css +74 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night.css +75 -0
- data/vendor/assets/bower_components/highlightjs/styles/tomorrow.css +72 -0
- data/vendor/assets/bower_components/highlightjs/styles/vs.css +68 -0
- data/vendor/assets/bower_components/highlightjs/styles/xcode.css +93 -0
- data/vendor/assets/bower_components/highlightjs/styles/zenburn.css +80 -0
- data/vendor/assets/bower_components/jquery.floatThead/CONTRIBUTING.md +33 -0
- data/vendor/assets/bower_components/jquery.floatThead/README.md +285 -0
- data/vendor/assets/bower_components/jquery.floatThead/bower.json +34 -0
- data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead-slim.js +899 -0
- data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead-slim.min.js +3 -0
- data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead.js +964 -0
- data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead.min.js +3 -0
- data/vendor/assets/bower_components/jquery.floatThead/license.txt +21 -0
- data/vendor/assets/bower_components/jquery/AUTHORS.txt +278 -0
- data/vendor/assets/bower_components/jquery/LICENSE.txt +36 -0
- data/vendor/assets/bower_components/jquery/README.md +65 -0
- data/vendor/assets/bower_components/jquery/bower.json +14 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.js +9842 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.min.js +4 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.min.map +1 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.slim.js +7877 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.slim.min.js +4 -0
- data/vendor/assets/bower_components/jquery/dist/jquery.slim.min.map +1 -0
- data/vendor/assets/bower_components/jquery/sizzle/LICENSE.txt +36 -0
- data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.js +2143 -0
- data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.min.js +3 -0
- data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.min.map +1 -0
- data/vendor/assets/bower_components/jquery/src/ajax.js +845 -0
- data/vendor/assets/bower_components/jquery/src/ajax/jsonp.js +100 -0
- data/vendor/assets/bower_components/jquery/src/ajax/load.js +83 -0
- data/vendor/assets/bower_components/jquery/src/ajax/parseJSON.js +13 -0
- data/vendor/assets/bower_components/jquery/src/ajax/parseXML.js +27 -0
- data/vendor/assets/bower_components/jquery/src/ajax/script.js +68 -0
- data/vendor/assets/bower_components/jquery/src/ajax/var/location.js +3 -0
- data/vendor/assets/bower_components/jquery/src/ajax/var/nonce.js +5 -0
- data/vendor/assets/bower_components/jquery/src/ajax/var/rquery.js +3 -0
- data/vendor/assets/bower_components/jquery/src/ajax/xhr.js +167 -0
- data/vendor/assets/bower_components/jquery/src/attributes.js +11 -0
- data/vendor/assets/bower_components/jquery/src/attributes/attr.js +142 -0
- data/vendor/assets/bower_components/jquery/src/attributes/classes.js +177 -0
- data/vendor/assets/bower_components/jquery/src/attributes/prop.js +125 -0
- data/vendor/assets/bower_components/jquery/src/attributes/support.js +36 -0
- data/vendor/assets/bower_components/jquery/src/attributes/val.js +177 -0
- data/vendor/assets/bower_components/jquery/src/callbacks.js +232 -0
- data/vendor/assets/bower_components/jquery/src/core.js +494 -0
- data/vendor/assets/bower_components/jquery/src/core/DOMEval.js +14 -0
- data/vendor/assets/bower_components/jquery/src/core/access.js +65 -0
- data/vendor/assets/bower_components/jquery/src/core/init.js +134 -0
- data/vendor/assets/bower_components/jquery/src/core/parseHTML.js +41 -0
- data/vendor/assets/bower_components/jquery/src/core/ready.js +103 -0
- data/vendor/assets/bower_components/jquery/src/core/support.js +18 -0
- data/vendor/assets/bower_components/jquery/src/core/var/rsingleTag.js +5 -0
- data/vendor/assets/bower_components/jquery/src/css.js +515 -0
- data/vendor/assets/bower_components/jquery/src/css/addGetHookIf.js +24 -0
- data/vendor/assets/bower_components/jquery/src/css/adjustCSS.js +65 -0
- data/vendor/assets/bower_components/jquery/src/css/curCSS.js +60 -0
- data/vendor/assets/bower_components/jquery/src/css/defaultDisplay.js +72 -0
- data/vendor/assets/bower_components/jquery/src/css/hiddenVisibleSelectors.js +18 -0
- data/vendor/assets/bower_components/jquery/src/css/showHide.js +48 -0
- data/vendor/assets/bower_components/jquery/src/css/support.js +121 -0
- data/vendor/assets/bower_components/jquery/src/css/var/cssExpand.js +3 -0
- data/vendor/assets/bower_components/jquery/src/css/var/getStyles.js +15 -0
- data/vendor/assets/bower_components/jquery/src/css/var/isHidden.js +16 -0
- data/vendor/assets/bower_components/jquery/src/css/var/rmargin.js +3 -0
- data/vendor/assets/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/vendor/assets/bower_components/jquery/src/css/var/swap.js +24 -0
- data/vendor/assets/bower_components/jquery/src/data.js +187 -0
- data/vendor/assets/bower_components/jquery/src/data/Data.js +200 -0
- data/vendor/assets/bower_components/jquery/src/data/accepts.js +20 -0
- data/vendor/assets/bower_components/jquery/src/data/support.js +23 -0
- data/vendor/assets/bower_components/jquery/src/data/var/acceptData.js +18 -0
- data/vendor/assets/bower_components/jquery/src/data/var/dataPriv.js +5 -0
- data/vendor/assets/bower_components/jquery/src/data/var/dataUser.js +5 -0
- data/vendor/assets/bower_components/jquery/src/deferred.js +158 -0
- data/vendor/assets/bower_components/jquery/src/deferred/exceptionHook.js +19 -0
- data/vendor/assets/bower_components/jquery/src/deprecated.js +32 -0
- data/vendor/assets/bower_components/jquery/src/dimensions.js +54 -0
- data/vendor/assets/bower_components/jquery/src/effects.js +629 -0
- data/vendor/assets/bower_components/jquery/src/effects/Tween.js +121 -0
- data/vendor/assets/bower_components/jquery/src/effects/animatedSelector.js +13 -0
- data/vendor/assets/bower_components/jquery/src/effects/support.js +58 -0
- data/vendor/assets/bower_components/jquery/src/event.js +710 -0
- data/vendor/assets/bower_components/jquery/src/event/ajax.js +20 -0
- data/vendor/assets/bower_components/jquery/src/event/alias.js +27 -0
- data/vendor/assets/bower_components/jquery/src/event/focusin.js +53 -0
- data/vendor/assets/bower_components/jquery/src/event/support.js +9 -0
- data/vendor/assets/bower_components/jquery/src/event/trigger.js +199 -0
- data/vendor/assets/bower_components/jquery/src/exports/amd.js +24 -0
- data/vendor/assets/bower_components/jquery/src/exports/global.js +26 -0
- data/vendor/assets/bower_components/jquery/src/intro.js +44 -0
- data/vendor/assets/bower_components/jquery/src/jquery.js +37 -0
- data/vendor/assets/bower_components/jquery/src/manipulation.js +481 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/_evalUrl.js +20 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/buildFragment.js +102 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/createSafeFragment.js +20 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/getAll.js +21 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/setGlobalEval.js +20 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/support.js +33 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/nodeNames.js +5 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/var/rtagName.js +3 -0
- data/vendor/assets/bower_components/jquery/src/manipulation/wrapMap.js +27 -0
- data/vendor/assets/bower_components/jquery/src/offset.js +218 -0
- data/vendor/assets/bower_components/jquery/src/outro.js +2 -0
- data/vendor/assets/bower_components/jquery/src/queue.js +143 -0
- data/vendor/assets/bower_components/jquery/src/queue/delay.js +22 -0
- data/vendor/assets/bower_components/jquery/src/selector-native.js +211 -0
- data/vendor/assets/bower_components/jquery/src/selector-sizzle.js +14 -0
- data/vendor/assets/bower_components/jquery/src/selector.js +1 -0
- data/vendor/assets/bower_components/jquery/src/serialize.js +125 -0
- data/vendor/assets/bower_components/jquery/src/support.js +63 -0
- data/vendor/assets/bower_components/jquery/src/traversing.js +175 -0
- data/vendor/assets/bower_components/jquery/src/traversing/findFilter.js +100 -0
- data/vendor/assets/bower_components/jquery/src/traversing/var/dir.js +20 -0
- data/vendor/assets/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/vendor/assets/bower_components/jquery/src/traversing/var/siblings.js +15 -0
- data/vendor/assets/bower_components/jquery/src/var/arr.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/class2type.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/concat.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/deletedIds.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/document.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/documentElement.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/hasOwn.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/indexOf.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/pnum.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/push.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/rcssNum.js +7 -0
- data/vendor/assets/bower_components/jquery/src/var/rnotwhite.js +3 -0
- data/vendor/assets/bower_components/jquery/src/var/slice.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/support.js +5 -0
- data/vendor/assets/bower_components/jquery/src/var/toString.js +5 -0
- data/vendor/assets/bower_components/jquery/src/wrap.js +79 -0
- data/vendor/assets/bower_components/marked/Gulpfile.js +22 -0
- data/vendor/assets/bower_components/marked/LICENSE +19 -0
- data/vendor/assets/bower_components/marked/Makefile +12 -0
- data/vendor/assets/bower_components/marked/README.md +406 -0
- data/vendor/assets/bower_components/marked/bin/marked +187 -0
- data/vendor/assets/bower_components/marked/bower.json +24 -0
- data/vendor/assets/bower_components/marked/component.json +10 -0
- data/vendor/assets/bower_components/marked/doc/broken.md +426 -0
- data/vendor/assets/bower_components/marked/doc/todo.md +2 -0
- data/vendor/assets/bower_components/marked/index.js +1 -0
- data/vendor/assets/bower_components/marked/lib/marked.js +1285 -0
- data/vendor/assets/bower_components/marked/man/marked.1 +91 -0
- data/vendor/assets/bower_components/marked/marked.min.js +6 -0
- data/vendor/assets/bower_components/marked/package.json +24 -0
- data/vendor/assets/bower_components/moment/CHANGELOG.md +423 -0
- data/vendor/assets/bower_components/moment/LICENSE +22 -0
- data/vendor/assets/bower_components/moment/Moment.js.nuspec +28 -0
- data/vendor/assets/bower_components/moment/README.md +39 -0
- data/vendor/assets/bower_components/moment/benchmarks/clone.js +10 -0
- data/vendor/assets/bower_components/moment/bower.json +20 -0
- data/vendor/assets/bower_components/moment/locale/af.js +71 -0
- data/vendor/assets/bower_components/moment/locale/ar-ma.js +57 -0
- data/vendor/assets/bower_components/moment/locale/ar-sa.js +101 -0
- data/vendor/assets/bower_components/moment/locale/ar-tn.js +55 -0
- data/vendor/assets/bower_components/moment/locale/ar.js +134 -0
- data/vendor/assets/bower_components/moment/locale/az.js +107 -0
- data/vendor/assets/bower_components/moment/locale/be.js +154 -0
- data/vendor/assets/bower_components/moment/locale/bg.js +88 -0
- data/vendor/assets/bower_components/moment/locale/bn.js +111 -0
- data/vendor/assets/bower_components/moment/locale/bo.js +108 -0
- data/vendor/assets/bower_components/moment/locale/br.js +109 -0
- data/vendor/assets/bower_components/moment/locale/bs.js +140 -0
- data/vendor/assets/bower_components/moment/locale/ca.js +77 -0
- data/vendor/assets/bower_components/moment/locale/cs.js +157 -0
- data/vendor/assets/bower_components/moment/locale/cv.js +61 -0
- data/vendor/assets/bower_components/moment/locale/cy.js +79 -0
- data/vendor/assets/bower_components/moment/locale/da.js +58 -0
- data/vendor/assets/bower_components/moment/locale/de-at.js +74 -0
- data/vendor/assets/bower_components/moment/locale/de.js +73 -0
- data/vendor/assets/bower_components/moment/locale/el.js +94 -0
- data/vendor/assets/bower_components/moment/locale/en-au.js +64 -0
- data/vendor/assets/bower_components/moment/locale/en-ca.js +61 -0
- data/vendor/assets/bower_components/moment/locale/en-gb.js +65 -0
- data/vendor/assets/bower_components/moment/locale/eo.js +71 -0
- data/vendor/assets/bower_components/moment/locale/es.js +77 -0
- data/vendor/assets/bower_components/moment/locale/et.js +78 -0
- data/vendor/assets/bower_components/moment/locale/eu.js +62 -0
- data/vendor/assets/bower_components/moment/locale/fa.js +103 -0
- data/vendor/assets/bower_components/moment/locale/fi.js +107 -0
- data/vendor/assets/bower_components/moment/locale/fo.js +58 -0
- data/vendor/assets/bower_components/moment/locale/fr-ca.js +56 -0
- data/vendor/assets/bower_components/moment/locale/fr.js +60 -0
- data/vendor/assets/bower_components/moment/locale/fy.js +69 -0
- data/vendor/assets/bower_components/moment/locale/gl.js +73 -0
- data/vendor/assets/bower_components/moment/locale/he.js +80 -0
- data/vendor/assets/bower_components/moment/locale/hi.js +121 -0
- data/vendor/assets/bower_components/moment/locale/hr.js +141 -0
- data/vendor/assets/bower_components/moment/locale/hu.js +111 -0
- data/vendor/assets/bower_components/moment/locale/hy-am.js +118 -0
- data/vendor/assets/bower_components/moment/locale/id.js +81 -0
- data/vendor/assets/bower_components/moment/locale/is.js +126 -0
- data/vendor/assets/bower_components/moment/locale/it.js +68 -0
- data/vendor/assets/bower_components/moment/locale/ja.js +63 -0
- data/vendor/assets/bower_components/moment/locale/ka.js +109 -0
- data/vendor/assets/bower_components/moment/locale/km.js +56 -0
- data/vendor/assets/bower_components/moment/locale/ko.js +65 -0
- data/vendor/assets/bower_components/moment/locale/lb.js +139 -0
- data/vendor/assets/bower_components/moment/locale/lt.js +120 -0
- data/vendor/assets/bower_components/moment/locale/lv.js +79 -0
- data/vendor/assets/bower_components/moment/locale/mk.js +88 -0
- data/vendor/assets/bower_components/moment/locale/ml.js +69 -0
- data/vendor/assets/bower_components/moment/locale/mr.js +120 -0
- data/vendor/assets/bower_components/moment/locale/ms-my.js +80 -0
- data/vendor/assets/bower_components/moment/locale/my.js +89 -0
- data/vendor/assets/bower_components/moment/locale/nb.js +59 -0
- data/vendor/assets/bower_components/moment/locale/ne.js +121 -0
- data/vendor/assets/bower_components/moment/locale/nl.js +69 -0
- data/vendor/assets/bower_components/moment/locale/nn.js +58 -0
- data/vendor/assets/bower_components/moment/locale/pl.js +100 -0
- data/vendor/assets/bower_components/moment/locale/pt-br.js +58 -0
- data/vendor/assets/bower_components/moment/locale/pt.js +62 -0
- data/vendor/assets/bower_components/moment/locale/ro.js +73 -0
- data/vendor/assets/bower_components/moment/locale/ru.js +176 -0
- data/vendor/assets/bower_components/moment/locale/sk.js +158 -0
- data/vendor/assets/bower_components/moment/locale/sl.js +146 -0
- data/vendor/assets/bower_components/moment/locale/sq.js +67 -0
- data/vendor/assets/bower_components/moment/locale/sr-cyrl.js +107 -0
- data/vendor/assets/bower_components/moment/locale/sr.js +107 -0
- data/vendor/assets/bower_components/moment/locale/sv.js +65 -0
- data/vendor/assets/bower_components/moment/locale/ta.js +130 -0
- data/vendor/assets/bower_components/moment/locale/th.js +63 -0
- data/vendor/assets/bower_components/moment/locale/tl-ph.js +60 -0
- data/vendor/assets/bower_components/moment/locale/tr.js +94 -0
- data/vendor/assets/bower_components/moment/locale/tzm-latn.js +56 -0
- data/vendor/assets/bower_components/moment/locale/tzm.js +56 -0
- data/vendor/assets/bower_components/moment/locale/uk.js +163 -0
- data/vendor/assets/bower_components/moment/locale/uz.js +56 -0
- data/vendor/assets/bower_components/moment/locale/vi.js +64 -0
- data/vendor/assets/bower_components/moment/locale/zh-cn.js +125 -0
- data/vendor/assets/bower_components/moment/locale/zh-tw.js +99 -0
- data/vendor/assets/bower_components/moment/meteor/README.md +25 -0
- data/vendor/assets/bower_components/moment/meteor/export.js +3 -0
- data/vendor/assets/bower_components/moment/meteor/test.js +5 -0
- data/vendor/assets/bower_components/moment/min/locales.js +7306 -0
- data/vendor/assets/bower_components/moment/min/locales.min.js +4 -0
- data/vendor/assets/bower_components/moment/min/moment-with-locales.js +9792 -0
- data/vendor/assets/bower_components/moment/min/moment-with-locales.min.js +10 -0
- data/vendor/assets/bower_components/moment/min/moment.min.js +7 -0
- data/vendor/assets/bower_components/moment/moment.js +3043 -0
- data/vendor/assets/bower_components/moment/scripts/npm_prepublish.sh +43 -0
- data/vendor/assets/bower_components/underscore/LICENSE +23 -0
- data/vendor/assets/bower_components/underscore/README.md +22 -0
- data/vendor/assets/bower_components/underscore/bower.json +7 -0
- data/vendor/assets/bower_components/underscore/underscore-min.js +6 -0
- data/vendor/assets/bower_components/underscore/underscore-min.map +1 -0
- data/vendor/assets/bower_components/underscore/underscore.js +1548 -0
- metadata +782 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"name": "jquery.floatThead",
|
3
|
+
"homepage": "http://mkoryak.github.io/floatThead/",
|
4
|
+
"authors": [
|
5
|
+
"Misha Koryak"
|
6
|
+
],
|
7
|
+
"description": "Unobtrusively float any table's header without breaking styles or events",
|
8
|
+
"main": [
|
9
|
+
"dist/jquery.floatThead.js",
|
10
|
+
"dist/jquery.floatThead.min.js"
|
11
|
+
],
|
12
|
+
"browser": [
|
13
|
+
"dist/jquery.floatThead.min.js"
|
14
|
+
],
|
15
|
+
"keywords": [
|
16
|
+
"float table header", "locked header", "table header", "table", "sticky header", "floatThead", "scrolling table", "fixed header"
|
17
|
+
],
|
18
|
+
"license": "MIT",
|
19
|
+
"ignore": [
|
20
|
+
"**/.*",
|
21
|
+
"node_modules",
|
22
|
+
"bower_components",
|
23
|
+
"test",
|
24
|
+
"demo",
|
25
|
+
"Gruntfile.coffee",
|
26
|
+
"jquery.floatThead._.js",
|
27
|
+
"jquery.floatThead.js",
|
28
|
+
"package.json",
|
29
|
+
".gitignore"
|
30
|
+
],
|
31
|
+
"dependencies": {
|
32
|
+
"jquery": ">= 1.8.0"
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,899 @@
|
|
1
|
+
// @preserve jQuery.floatThead 1.3.2 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2015 Misha Koryak
|
2
|
+
// @license MIT
|
3
|
+
|
4
|
+
/* @author Misha Koryak
|
5
|
+
* @projectDescription lock a table header in place while scrolling - without breaking styles or events bound to the header
|
6
|
+
*
|
7
|
+
* Dependencies:
|
8
|
+
* jquery 1.9.0 + [required] OR jquery 1.7.0 + jquery UI core
|
9
|
+
*
|
10
|
+
* http://mkoryak.github.io/floatThead/
|
11
|
+
*
|
12
|
+
* Tested on FF13+, Chrome 21+, IE8, IE9, IE10, IE11
|
13
|
+
*
|
14
|
+
*/
|
15
|
+
(function( $ ) {
|
16
|
+
/**
|
17
|
+
* provides a default config object. You can modify this after including this script if you want to change the init defaults
|
18
|
+
* @type {Object}
|
19
|
+
*/
|
20
|
+
$.floatThead = $.floatThead || {};
|
21
|
+
$.floatThead.defaults = {
|
22
|
+
headerCellSelector: 'tr:visible:first>*:visible', //thead cells are this.
|
23
|
+
zIndex: 1001, //zindex of the floating thead (actually a container div)
|
24
|
+
position: 'auto', // 'fixed', 'absolute', 'auto'. auto picks the best for your table scrolling type.
|
25
|
+
top: 0, //String or function($table) - offset from top of window where the header should not pass above
|
26
|
+
bottom: 0, //String or function($table) - offset from the bottom of the table where the header should stop scrolling
|
27
|
+
scrollContainer: function($table){
|
28
|
+
return $([]); //if the table has horizontal scroll bars then this is the container that has overflow:auto and causes those scroll bars
|
29
|
+
},
|
30
|
+
getSizingRow: function($table, $cols, $fthCells){ // this is only called when using IE,
|
31
|
+
// override it if the first row of the table is going to contain colgroups (any cell spans greater than one col)
|
32
|
+
// it should return a jquery object containing a wrapped set of table cells comprising a row that contains no col spans and is visible
|
33
|
+
return $table.find('tbody tr:visible:first>*:visible');
|
34
|
+
},
|
35
|
+
floatTableClass: 'floatThead-table',
|
36
|
+
floatWrapperClass: 'floatThead-wrapper',
|
37
|
+
floatContainerClass: 'floatThead-container',
|
38
|
+
copyTableClass: true, //copy 'class' attribute from table into the floated table so that the styles match.
|
39
|
+
enableAria: false, //will copy header text from the floated header back into the table for screen readers. Might cause the css styling to be off. beware!
|
40
|
+
autoReflow: false, //(undocumented) - use MutationObserver api to reflow automatically when internal table DOM changes
|
41
|
+
debug: false //print possible issues (that don't prevent script loading) to console, if console exists.
|
42
|
+
};
|
43
|
+
|
44
|
+
var util = window._;
|
45
|
+
|
46
|
+
var canObserveMutations = typeof MutationObserver !== 'undefined';
|
47
|
+
|
48
|
+
|
49
|
+
//browser stuff
|
50
|
+
var ieVersion = function(){for(var a=3,b=document.createElement("b"),c=b.all||[];a = 1+a,b.innerHTML="<!--[if gt IE "+ a +"]><i><![endif]-->",c[0];);return 4<a?a:document.documentMode}();
|
51
|
+
var isFF = /Gecko\//.test(navigator.userAgent);
|
52
|
+
var isWebkit = /WebKit\//.test(navigator.userAgent);
|
53
|
+
|
54
|
+
//safari 7 (and perhaps others) reports table width to be parent container's width if max-width is set on table. see: https://github.com/mkoryak/floatThead/issues/108
|
55
|
+
var isTableWidthBug = function(){
|
56
|
+
if(isWebkit) {
|
57
|
+
var $test = $('<div style="width:0px"><table style="max-width:100%"><tr><th><div style="min-width:100px;">X</div></th></tr></table></div>');
|
58
|
+
$("body").append($test);
|
59
|
+
var ret = ($test.find("table").width() == 0);
|
60
|
+
$test.remove();
|
61
|
+
return ret;
|
62
|
+
}
|
63
|
+
return false;
|
64
|
+
};
|
65
|
+
|
66
|
+
var createElements = !isFF && !ieVersion; //FF can read width from <col> elements, but webkit cannot
|
67
|
+
|
68
|
+
var $window = $(window);
|
69
|
+
|
70
|
+
/**
|
71
|
+
* @param debounceMs
|
72
|
+
* @param cb
|
73
|
+
*/
|
74
|
+
function windowResize(eventName, cb){
|
75
|
+
if(ieVersion == 8){ //ie8 is crap: https://github.com/mkoryak/floatThead/issues/65
|
76
|
+
var winWidth = $window.width();
|
77
|
+
var debouncedCb = util.debounce(function(){
|
78
|
+
var winWidthNew = $window.width();
|
79
|
+
if(winWidth != winWidthNew){
|
80
|
+
winWidth = winWidthNew;
|
81
|
+
cb();
|
82
|
+
}
|
83
|
+
}, 1);
|
84
|
+
$window.on(eventName, debouncedCb);
|
85
|
+
} else {
|
86
|
+
$window.on(eventName, util.debounce(cb, 1));
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
function debug(str){
|
92
|
+
window && window.console && window.console.error && window.console.error("jQuery.floatThead: " + str);
|
93
|
+
}
|
94
|
+
|
95
|
+
//returns fractional pixel widths
|
96
|
+
function getOffsetWidth(el) {
|
97
|
+
var rect = el.getBoundingClientRect();
|
98
|
+
return rect.width || rect.right - rect.left;
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* try to calculate the scrollbar width for your browser/os
|
103
|
+
* @return {Number}
|
104
|
+
*/
|
105
|
+
function scrollbarWidth() {
|
106
|
+
var $div = $( //borrowed from anti-scroll
|
107
|
+
'<div style="width:50px;height:50px;overflow-y:scroll;'
|
108
|
+
+ 'position:absolute;top:-200px;left:-200px;"><div style="height:100px;width:100%">'
|
109
|
+
+ '</div>'
|
110
|
+
);
|
111
|
+
$('body').append($div);
|
112
|
+
var w1 = $div.innerWidth();
|
113
|
+
var w2 = $('div', $div).innerWidth();
|
114
|
+
$div.remove();
|
115
|
+
return w1 - w2;
|
116
|
+
}
|
117
|
+
/**
|
118
|
+
* Check if a given table has been datatableized (http://datatables.net)
|
119
|
+
* @param $table
|
120
|
+
* @return {Boolean}
|
121
|
+
*/
|
122
|
+
function isDatatable($table){
|
123
|
+
if($table.dataTableSettings){
|
124
|
+
for(var i = 0; i < $table.dataTableSettings.length; i++){
|
125
|
+
var table = $table.dataTableSettings[i].nTable;
|
126
|
+
if($table[0] == table){
|
127
|
+
return true;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
}
|
131
|
+
return false;
|
132
|
+
}
|
133
|
+
|
134
|
+
function tableWidth($table, $fthCells, isOuter){
|
135
|
+
// see: https://github.com/mkoryak/floatThead/issues/108
|
136
|
+
var fn = isOuter ? "outerWidth": "width";
|
137
|
+
if(isTableWidthBug && $table.css("max-width")){
|
138
|
+
var w = 0;
|
139
|
+
if(isOuter) {
|
140
|
+
w += parseInt($table.css("borderLeft"), 10);
|
141
|
+
w += parseInt($table.css("borderRight"), 10);
|
142
|
+
}
|
143
|
+
for(var i=0; i < $fthCells.length; i++){
|
144
|
+
w += $fthCells.get(i).offsetWidth;
|
145
|
+
}
|
146
|
+
return w;
|
147
|
+
} else {
|
148
|
+
return $table[fn]();
|
149
|
+
}
|
150
|
+
}
|
151
|
+
$.fn.floatThead = function(map){
|
152
|
+
map = map || {};
|
153
|
+
if(!util){ //may have been included after the script? lets try to grab it again.
|
154
|
+
util = window._ || $.floatThead._;
|
155
|
+
if(!util){
|
156
|
+
throw new Error("jquery.floatThead-slim.js requires underscore. You should use the non-lite version since you do not have underscore.");
|
157
|
+
}
|
158
|
+
}
|
159
|
+
|
160
|
+
if(ieVersion < 8){
|
161
|
+
return this; //no more crappy browser support.
|
162
|
+
}
|
163
|
+
|
164
|
+
var mObs = null; //mutation observer lives in here if we can use it / make it
|
165
|
+
|
166
|
+
if(util.isFunction(isTableWidthBug)) {
|
167
|
+
isTableWidthBug = isTableWidthBug();
|
168
|
+
}
|
169
|
+
|
170
|
+
if(util.isString(map)){
|
171
|
+
var command = map;
|
172
|
+
var ret = this;
|
173
|
+
this.filter('table').each(function(){
|
174
|
+
var $this = $(this);
|
175
|
+
var opts = $this.data('floatThead-lazy');
|
176
|
+
if(opts){
|
177
|
+
$this.floatThead(opts);
|
178
|
+
}
|
179
|
+
var obj = $this.data('floatThead-attached');
|
180
|
+
if(obj && util.isFunction(obj[command])){
|
181
|
+
var r = obj[command]();
|
182
|
+
if(typeof r !== 'undefined'){
|
183
|
+
ret = r;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
});
|
187
|
+
return ret;
|
188
|
+
}
|
189
|
+
var opts = $.extend({}, $.floatThead.defaults || {}, map);
|
190
|
+
|
191
|
+
$.each(map, function(key, val){
|
192
|
+
if((!(key in $.floatThead.defaults)) && opts.debug){
|
193
|
+
debug("Used ["+key+"] key to init plugin, but that param is not an option for the plugin. Valid options are: "+ (util.keys($.floatThead.defaults)).join(', '));
|
194
|
+
}
|
195
|
+
});
|
196
|
+
if(opts.debug){
|
197
|
+
var v = $.fn.jquery.split(".");
|
198
|
+
if(parseInt(v[0], 10) == 1 && parseInt(v[1], 10) <= 7){
|
199
|
+
debug("jQuery version "+$.fn.jquery+" detected! This plugin supports 1.8 or better, or 1.7.x with jQuery UI 1.8.24 -> http://jqueryui.com/resources/download/jquery-ui-1.8.24.zip")
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
this.filter(':not(.'+opts.floatTableClass+')').each(function(){
|
204
|
+
var floatTheadId = util.uniqueId();
|
205
|
+
var $table = $(this);
|
206
|
+
if($table.data('floatThead-attached')){
|
207
|
+
return true; //continue the each loop
|
208
|
+
}
|
209
|
+
if(!$table.is('table')){
|
210
|
+
throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');
|
211
|
+
}
|
212
|
+
canObserveMutations = opts.autoReflow && canObserveMutations; //option defaults to false!
|
213
|
+
var $header = $table.children('thead:first');
|
214
|
+
var $tbody = $table.children('tbody:first');
|
215
|
+
if($header.length == 0 || $tbody.length == 0){
|
216
|
+
$table.data('floatThead-lazy', opts);
|
217
|
+
$table.unbind("reflow").one('reflow', function(){
|
218
|
+
$table.floatThead(opts);
|
219
|
+
});
|
220
|
+
return;
|
221
|
+
}
|
222
|
+
if($table.data('floatThead-lazy')){
|
223
|
+
$table.unbind("reflow");
|
224
|
+
}
|
225
|
+
$table.data('floatThead-lazy', false);
|
226
|
+
|
227
|
+
var headerFloated = true;
|
228
|
+
var scrollingTop, scrollingBottom;
|
229
|
+
var scrollbarOffset = {vertical: 0, horizontal: 0};
|
230
|
+
var scWidth = scrollbarWidth();
|
231
|
+
var lastColumnCount = 0; //used by columnNum()
|
232
|
+
var $scrollContainer = opts.scrollContainer($table) || $([]); //guard against returned nulls
|
233
|
+
var locked = $scrollContainer.length > 0;
|
234
|
+
|
235
|
+
var useAbsolutePositioning = null;
|
236
|
+
if(typeof opts.useAbsolutePositioning !== 'undefined'){
|
237
|
+
opts.position = 'auto';
|
238
|
+
if(opts.useAbsolutePositioning){
|
239
|
+
opts.position = opts.useAbsolutePositioning ? 'absolute' : 'fixed';
|
240
|
+
}
|
241
|
+
debug("option 'useAbsolutePositioning' has been removed in v1.3.0, use `position:'"+opts.position+"'` instead. See docs for more info: http://mkoryak.github.io/floatThead/#options")
|
242
|
+
}
|
243
|
+
if(typeof opts.scrollingTop !== 'undefined'){
|
244
|
+
opts.top = opts.scrollingTop;
|
245
|
+
debug("option 'scrollingTop' has been renamed to 'top' in v1.3.0. See docs for more info: http://mkoryak.github.io/floatThead/#options");
|
246
|
+
}
|
247
|
+
if(typeof opts.scrollingBottom !== 'undefined'){
|
248
|
+
opts.bottom = opts.scrollingBottom;
|
249
|
+
debug("option 'scrollingBottom' has been renamed to 'bottom' in v1.3.0. See docs for more info: http://mkoryak.github.io/floatThead/#options");
|
250
|
+
}
|
251
|
+
|
252
|
+
|
253
|
+
if (opts.position == 'auto') {
|
254
|
+
useAbsolutePositioning = null;
|
255
|
+
} else if (opts.position == 'fixed') {
|
256
|
+
useAbsolutePositioning = false;
|
257
|
+
} else if (opts.position == 'absolute'){
|
258
|
+
useAbsolutePositioning = true;
|
259
|
+
} else if (opts.debug) {
|
260
|
+
debug('Invalid value given to "position" option, valid is "fixed", "absolute" and "auto". You passed: ', opts.position);
|
261
|
+
}
|
262
|
+
|
263
|
+
if(useAbsolutePositioning == null){ //defaults: locked=true, !locked=false
|
264
|
+
useAbsolutePositioning = locked;
|
265
|
+
}
|
266
|
+
var $caption = $table.find("caption");
|
267
|
+
var haveCaption = $caption.length == 1;
|
268
|
+
if(haveCaption){
|
269
|
+
var captionAlignTop = ($caption.css("caption-side") || $caption.attr("align") || "top") === "top";
|
270
|
+
}
|
271
|
+
|
272
|
+
var $fthGrp = $('<fthfoot style="display:table-footer-group;border-spacing:0;height:0;border-collapse:collapse;visibility:hidden"/>');
|
273
|
+
|
274
|
+
var wrappedContainer = false; //used with absolute positioning enabled. did we need to wrap the scrollContainer/table with a relative div?
|
275
|
+
var $wrapper = $([]); //used when absolute positioning enabled - wraps the table and the float container
|
276
|
+
var absoluteToFixedOnScroll = ieVersion <= 9 && !locked && useAbsolutePositioning; //on IE using absolute positioning doesn't look good with window scrolling, so we change position to fixed on scroll, and then change it back to absolute when done.
|
277
|
+
var $floatTable = $("<table/>");
|
278
|
+
var $floatColGroup = $("<colgroup/>");
|
279
|
+
var $tableColGroup = $table.children('colgroup:first');
|
280
|
+
var existingColGroup = true;
|
281
|
+
if($tableColGroup.length == 0){
|
282
|
+
$tableColGroup = $("<colgroup/>");
|
283
|
+
existingColGroup = false;
|
284
|
+
}
|
285
|
+
var $fthRow = $('<fthtr style="display:table-row;border-spacing:0;height:0;border-collapse:collapse"/>'); //created unstyled elements (used for sizing the table because chrome can't read <col> width)
|
286
|
+
var $floatContainer = $('<div style="overflow: hidden;" aria-hidden="true"></div>');
|
287
|
+
var floatTableHidden = false; //this happens when the table is hidden and we do magic when making it visible
|
288
|
+
var $newHeader = $("<thead/>");
|
289
|
+
var $sizerRow = $('<tr class="size-row"/>');
|
290
|
+
var $sizerCells = $([]);
|
291
|
+
var $tableCells = $([]); //used for sizing - either $sizerCells or $tableColGroup cols. $tableColGroup cols are only created in chrome for borderCollapse:collapse because of a chrome bug.
|
292
|
+
var $headerCells = $([]);
|
293
|
+
var $fthCells = $([]); //created elements
|
294
|
+
|
295
|
+
$newHeader.append($sizerRow);
|
296
|
+
$table.prepend($tableColGroup);
|
297
|
+
if(createElements){
|
298
|
+
$fthGrp.append($fthRow);
|
299
|
+
$table.append($fthGrp);
|
300
|
+
}
|
301
|
+
|
302
|
+
$floatTable.append($floatColGroup);
|
303
|
+
$floatContainer.append($floatTable);
|
304
|
+
if(opts.copyTableClass){
|
305
|
+
$floatTable.attr('class', $table.attr('class'));
|
306
|
+
}
|
307
|
+
$floatTable.attr({ //copy over some deprecated table attributes that people still like to use. Good thing people don't use colgroups...
|
308
|
+
'cellpadding': $table.attr('cellpadding'),
|
309
|
+
'cellspacing': $table.attr('cellspacing'),
|
310
|
+
'border': $table.attr('border')
|
311
|
+
});
|
312
|
+
var tableDisplayCss = $table.css('display');
|
313
|
+
$floatTable.css({
|
314
|
+
'borderCollapse': $table.css('borderCollapse'),
|
315
|
+
'border': $table.css('border'),
|
316
|
+
'display': tableDisplayCss
|
317
|
+
});
|
318
|
+
if(tableDisplayCss == 'none'){
|
319
|
+
floatTableHidden = true;
|
320
|
+
}
|
321
|
+
|
322
|
+
$floatTable.addClass(opts.floatTableClass).css({'margin': 0, 'border-bottom-width': 0}); //must have no margins or you won't be able to click on things under floating table
|
323
|
+
|
324
|
+
if(useAbsolutePositioning){
|
325
|
+
var makeRelative = function($container, alwaysWrap){
|
326
|
+
var positionCss = $container.css('position');
|
327
|
+
var relativeToScrollContainer = (positionCss == "relative" || positionCss == "absolute");
|
328
|
+
var $containerWrap = $container;
|
329
|
+
if(!relativeToScrollContainer || alwaysWrap){
|
330
|
+
var css = {"paddingLeft": $container.css('paddingLeft'), "paddingRight": $container.css('paddingRight')};
|
331
|
+
$floatContainer.css(css);
|
332
|
+
$containerWrap = $container.data('floatThead-containerWrap') || $container.wrap("<div class='"+opts.floatWrapperClass+"' style='position: relative; clear:both;'></div>").parent();
|
333
|
+
$container.data('floatThead-containerWrap', $containerWrap); //multiple tables inside one scrolling container - #242
|
334
|
+
wrappedContainer = true;
|
335
|
+
}
|
336
|
+
return $containerWrap;
|
337
|
+
};
|
338
|
+
if(locked){
|
339
|
+
$wrapper = makeRelative($scrollContainer, true);
|
340
|
+
$wrapper.prepend($floatContainer);
|
341
|
+
} else {
|
342
|
+
$wrapper = makeRelative($table);
|
343
|
+
$table.before($floatContainer);
|
344
|
+
}
|
345
|
+
} else {
|
346
|
+
$table.before($floatContainer);
|
347
|
+
}
|
348
|
+
|
349
|
+
|
350
|
+
$floatContainer.css({
|
351
|
+
position: useAbsolutePositioning ? 'absolute' : 'fixed',
|
352
|
+
marginTop: 0,
|
353
|
+
top: useAbsolutePositioning ? 0 : 'auto',
|
354
|
+
zIndex: opts.zIndex
|
355
|
+
});
|
356
|
+
$floatContainer.addClass(opts.floatContainerClass);
|
357
|
+
updateScrollingOffsets();
|
358
|
+
|
359
|
+
var layoutFixed = {'table-layout': 'fixed'};
|
360
|
+
var layoutAuto = {'table-layout': $table.css('tableLayout') || 'auto'};
|
361
|
+
var originalTableWidth = $table[0].style.width || ""; //setting this to auto is bad: #70
|
362
|
+
var originalTableMinWidth = $table.css('minWidth') || "";
|
363
|
+
|
364
|
+
function eventName(name){
|
365
|
+
return name+'.fth-'+floatTheadId+'.floatTHead'
|
366
|
+
}
|
367
|
+
|
368
|
+
function setHeaderHeight(){
|
369
|
+
var headerHeight = 0;
|
370
|
+
$header.children("tr:visible").each(function(){
|
371
|
+
headerHeight += $(this).outerHeight(true);
|
372
|
+
});
|
373
|
+
if($table.css('border-collapse') == 'collapse') {
|
374
|
+
var tableBorderTopHeight = parseInt($table.css('border-top-width'), 10);
|
375
|
+
var cellBorderTopHeight = parseInt($table.find("thead tr:first").find(">*:first").css('border-top-width'), 10);
|
376
|
+
if(tableBorderTopHeight > cellBorderTopHeight) {
|
377
|
+
headerHeight -= (tableBorderTopHeight / 2); //id love to see some docs where this magic recipe is found..
|
378
|
+
}
|
379
|
+
}
|
380
|
+
$sizerRow.outerHeight(headerHeight);
|
381
|
+
$sizerCells.outerHeight(headerHeight);
|
382
|
+
}
|
383
|
+
|
384
|
+
|
385
|
+
function setFloatWidth(){
|
386
|
+
var tw = tableWidth($table, $fthCells, true);
|
387
|
+
var width = $scrollContainer.width() || tw;
|
388
|
+
var floatContainerWidth = $scrollContainer.css("overflow-y") != 'hidden' ? width - scrollbarOffset.vertical : width;
|
389
|
+
$floatContainer.width(floatContainerWidth);
|
390
|
+
if(locked){
|
391
|
+
var percent = 100 * tw / (floatContainerWidth);
|
392
|
+
$floatTable.css('width', percent+'%');
|
393
|
+
} else {
|
394
|
+
$floatTable.outerWidth(tw);
|
395
|
+
}
|
396
|
+
}
|
397
|
+
|
398
|
+
function updateScrollingOffsets(){
|
399
|
+
scrollingTop = (util.isFunction(opts.top) ? opts.top($table) : opts.top) || 0;
|
400
|
+
scrollingBottom = (util.isFunction(opts.bottom) ? opts.bottom($table) : opts.bottom) || 0;
|
401
|
+
}
|
402
|
+
|
403
|
+
/**
|
404
|
+
* get the number of columns and also rebuild resizer rows if the count is different than the last count
|
405
|
+
*/
|
406
|
+
function columnNum(){
|
407
|
+
var count;
|
408
|
+
var $headerColumns = $header.find(opts.headerCellSelector);
|
409
|
+
if(existingColGroup){
|
410
|
+
count = $tableColGroup.find('col').length;
|
411
|
+
} else {
|
412
|
+
count = 0;
|
413
|
+
$headerColumns.each(function () {
|
414
|
+
count += parseInt(($(this).attr('colspan') || 1), 10);
|
415
|
+
});
|
416
|
+
}
|
417
|
+
if(count != lastColumnCount){
|
418
|
+
lastColumnCount = count;
|
419
|
+
var cells = [], cols = [], psuedo = [], content;
|
420
|
+
for(var x = 0; x < count; x++){
|
421
|
+
if (opts.enableAria && (content = $headerColumns.eq(x).text()) ) {
|
422
|
+
cells.push('<th scope="col" class="floatThead-col">' + content + '</th>');
|
423
|
+
} else {
|
424
|
+
cells.push('<th class="floatThead-col"/>');
|
425
|
+
}
|
426
|
+
cols.push('<col/>');
|
427
|
+
psuedo.push("<fthtd style='display:table-cell;height:0;width:auto;'/>");
|
428
|
+
}
|
429
|
+
|
430
|
+
cols = cols.join('');
|
431
|
+
cells = cells.join('');
|
432
|
+
|
433
|
+
if(createElements){
|
434
|
+
psuedo = psuedo.join('');
|
435
|
+
$fthRow.html(psuedo);
|
436
|
+
$fthCells = $fthRow.find('fthtd');
|
437
|
+
}
|
438
|
+
|
439
|
+
$sizerRow.html(cells);
|
440
|
+
$sizerCells = $sizerRow.find("th");
|
441
|
+
if(!existingColGroup){
|
442
|
+
$tableColGroup.html(cols);
|
443
|
+
}
|
444
|
+
$tableCells = $tableColGroup.find('col');
|
445
|
+
$floatColGroup.html(cols);
|
446
|
+
$headerCells = $floatColGroup.find("col");
|
447
|
+
|
448
|
+
}
|
449
|
+
return count;
|
450
|
+
}
|
451
|
+
|
452
|
+
function refloat(){ //make the thing float
|
453
|
+
if(!headerFloated){
|
454
|
+
headerFloated = true;
|
455
|
+
if(useAbsolutePositioning){ //#53, #56
|
456
|
+
var tw = tableWidth($table, $fthCells, true);
|
457
|
+
var wrapperWidth = $wrapper.width();
|
458
|
+
if(tw > wrapperWidth){
|
459
|
+
$table.css('minWidth', tw);
|
460
|
+
}
|
461
|
+
}
|
462
|
+
$table.css(layoutFixed);
|
463
|
+
$floatTable.css(layoutFixed);
|
464
|
+
$floatTable.append($header); //append because colgroup must go first in chrome
|
465
|
+
$tbody.before($newHeader);
|
466
|
+
setHeaderHeight();
|
467
|
+
}
|
468
|
+
}
|
469
|
+
function unfloat(){ //put the header back into the table
|
470
|
+
if(headerFloated){
|
471
|
+
headerFloated = false;
|
472
|
+
if(useAbsolutePositioning){ //#53, #56
|
473
|
+
$table.width(originalTableWidth);
|
474
|
+
}
|
475
|
+
$newHeader.detach();
|
476
|
+
$table.prepend($header);
|
477
|
+
$table.css(layoutAuto);
|
478
|
+
$floatTable.css(layoutAuto);
|
479
|
+
$table.css('minWidth', originalTableMinWidth); //this looks weird, but it's not a bug. Think about it!!
|
480
|
+
$table.css('minWidth', tableWidth($table, $fthCells)); //#121
|
481
|
+
}
|
482
|
+
}
|
483
|
+
var isHeaderFloatingLogical = false; //for the purpose of this event, the header is/isnt floating, even though the element
|
484
|
+
//might be in some other state. this is what the header looks like to the user
|
485
|
+
function triggerFloatEvent(isFloating){
|
486
|
+
if(isHeaderFloatingLogical != isFloating){
|
487
|
+
isHeaderFloatingLogical = isFloating;
|
488
|
+
$table.triggerHandler("floatThead", [isFloating, $floatContainer])
|
489
|
+
}
|
490
|
+
}
|
491
|
+
function changePositioning(isAbsolute){
|
492
|
+
if(useAbsolutePositioning != isAbsolute){
|
493
|
+
useAbsolutePositioning = isAbsolute;
|
494
|
+
$floatContainer.css({
|
495
|
+
position: useAbsolutePositioning ? 'absolute' : 'fixed'
|
496
|
+
});
|
497
|
+
}
|
498
|
+
}
|
499
|
+
function getSizingRow($table, $cols, $fthCells, ieVersion){
|
500
|
+
if(createElements){
|
501
|
+
return $fthCells;
|
502
|
+
} else if(ieVersion) {
|
503
|
+
return opts.getSizingRow($table, $cols, $fthCells);
|
504
|
+
} else {
|
505
|
+
return $cols;
|
506
|
+
}
|
507
|
+
}
|
508
|
+
|
509
|
+
/**
|
510
|
+
* returns a function that updates the floating header's cell widths.
|
511
|
+
* @return {Function}
|
512
|
+
*/
|
513
|
+
function reflow(){
|
514
|
+
var i;
|
515
|
+
var numCols = columnNum(); //if the tables columns changed dynamically since last time (datatables), rebuild the sizer rows and get a new count
|
516
|
+
|
517
|
+
return function(){
|
518
|
+
$tableCells = $tableColGroup.find('col');
|
519
|
+
var $rowCells = getSizingRow($table, $tableCells, $fthCells, ieVersion);
|
520
|
+
|
521
|
+
if($rowCells.length == numCols && numCols > 0){
|
522
|
+
if(!existingColGroup){
|
523
|
+
for(i=0; i < numCols; i++){
|
524
|
+
$tableCells.eq(i).css('width', '');
|
525
|
+
}
|
526
|
+
}
|
527
|
+
unfloat();
|
528
|
+
var widths = [];
|
529
|
+
for(i=0; i < numCols; i++){
|
530
|
+
widths[i] = getOffsetWidth($rowCells.get(i));
|
531
|
+
}
|
532
|
+
for(i=0; i < numCols; i++){
|
533
|
+
$headerCells.eq(i).width(widths[i]);
|
534
|
+
$tableCells.eq(i).width(widths[i]);
|
535
|
+
}
|
536
|
+
refloat();
|
537
|
+
} else {
|
538
|
+
$floatTable.append($header);
|
539
|
+
$table.css(layoutAuto);
|
540
|
+
$floatTable.css(layoutAuto);
|
541
|
+
setHeaderHeight();
|
542
|
+
}
|
543
|
+
$table.triggerHandler("reflowed", [$floatContainer]);
|
544
|
+
};
|
545
|
+
}
|
546
|
+
|
547
|
+
function floatContainerBorderWidth(side){
|
548
|
+
var border = $scrollContainer.css("border-"+side+"-width");
|
549
|
+
var w = 0;
|
550
|
+
if (border && ~border.indexOf('px')) {
|
551
|
+
w = parseInt(border, 10);
|
552
|
+
}
|
553
|
+
return w;
|
554
|
+
}
|
555
|
+
/**
|
556
|
+
* first performs initial calculations that we expect to not change when the table, window, or scrolling container are scrolled.
|
557
|
+
* returns a function that calculates the floating container's top and left coords. takes into account if we are using page scrolling or inner scrolling
|
558
|
+
* @return {Function}
|
559
|
+
*/
|
560
|
+
function calculateFloatContainerPosFn(){
|
561
|
+
var scrollingContainerTop = $scrollContainer.scrollTop();
|
562
|
+
|
563
|
+
//this floatEnd calc was moved out of the returned function because we assume the table height doesn't change (otherwise we must reinit by calling calculateFloatContainerPosFn)
|
564
|
+
var floatEnd;
|
565
|
+
var tableContainerGap = 0;
|
566
|
+
var captionHeight = haveCaption ? $caption.outerHeight(true) : 0;
|
567
|
+
var captionScrollOffset = captionAlignTop ? captionHeight : -captionHeight;
|
568
|
+
|
569
|
+
var floatContainerHeight = $floatContainer.height();
|
570
|
+
var tableOffset = $table.offset();
|
571
|
+
var tableLeftGap = 0; //can be caused by border on container (only in locked mode)
|
572
|
+
var tableTopGap = 0;
|
573
|
+
if(locked){
|
574
|
+
var containerOffset = $scrollContainer.offset();
|
575
|
+
tableContainerGap = tableOffset.top - containerOffset.top + scrollingContainerTop;
|
576
|
+
if(haveCaption && captionAlignTop){
|
577
|
+
tableContainerGap += captionHeight;
|
578
|
+
}
|
579
|
+
tableLeftGap = floatContainerBorderWidth('left');
|
580
|
+
tableTopGap = floatContainerBorderWidth('top');
|
581
|
+
tableContainerGap -= tableTopGap;
|
582
|
+
} else {
|
583
|
+
floatEnd = tableOffset.top - scrollingTop - floatContainerHeight + scrollingBottom + scrollbarOffset.horizontal;
|
584
|
+
}
|
585
|
+
var windowTop = $window.scrollTop();
|
586
|
+
var windowLeft = $window.scrollLeft();
|
587
|
+
var scrollContainerLeft = $scrollContainer.scrollLeft();
|
588
|
+
|
589
|
+
return function(eventType){
|
590
|
+
var isTableHidden = $table[0].offsetWidth <= 0 && $table[0].offsetHeight <= 0;
|
591
|
+
if(!isTableHidden && floatTableHidden) {
|
592
|
+
floatTableHidden = false;
|
593
|
+
setTimeout(function(){
|
594
|
+
$table.triggerHandler("reflow");
|
595
|
+
}, 1);
|
596
|
+
return null;
|
597
|
+
}
|
598
|
+
if(isTableHidden){ //it's hidden
|
599
|
+
floatTableHidden = true;
|
600
|
+
if(!useAbsolutePositioning){
|
601
|
+
return null;
|
602
|
+
}
|
603
|
+
}
|
604
|
+
|
605
|
+
if(eventType == 'windowScroll'){
|
606
|
+
windowTop = $window.scrollTop();
|
607
|
+
windowLeft = $window.scrollLeft();
|
608
|
+
} else if(eventType == 'containerScroll'){
|
609
|
+
scrollingContainerTop = $scrollContainer.scrollTop();
|
610
|
+
scrollContainerLeft = $scrollContainer.scrollLeft();
|
611
|
+
} else if(eventType != 'init') {
|
612
|
+
windowTop = $window.scrollTop();
|
613
|
+
windowLeft = $window.scrollLeft();
|
614
|
+
scrollingContainerTop = $scrollContainer.scrollTop();
|
615
|
+
scrollContainerLeft = $scrollContainer.scrollLeft();
|
616
|
+
}
|
617
|
+
if(isWebkit && (windowTop < 0 || windowLeft < 0)){ //chrome overscroll effect at the top of the page - breaks fixed positioned floated headers
|
618
|
+
return;
|
619
|
+
}
|
620
|
+
|
621
|
+
if(absoluteToFixedOnScroll){
|
622
|
+
if(eventType == 'windowScrollDone'){
|
623
|
+
changePositioning(true); //change to absolute
|
624
|
+
} else {
|
625
|
+
changePositioning(false); //change to fixed
|
626
|
+
}
|
627
|
+
} else if(eventType == 'windowScrollDone'){
|
628
|
+
return null; //event is fired when they stop scrolling. ignore it if not 'absoluteToFixedOnScroll'
|
629
|
+
}
|
630
|
+
|
631
|
+
tableOffset = $table.offset();
|
632
|
+
if(haveCaption && captionAlignTop){
|
633
|
+
tableOffset.top += captionHeight;
|
634
|
+
}
|
635
|
+
var top, left;
|
636
|
+
var tableHeight = $table.outerHeight();
|
637
|
+
|
638
|
+
if(locked && useAbsolutePositioning){ //inner scrolling, absolute positioning
|
639
|
+
if (tableContainerGap >= scrollingContainerTop) {
|
640
|
+
var gap = tableContainerGap - scrollingContainerTop + tableTopGap;
|
641
|
+
top = gap > 0 ? gap : 0;
|
642
|
+
triggerFloatEvent(false);
|
643
|
+
} else {
|
644
|
+
top = wrappedContainer ? tableTopGap : scrollingContainerTop;
|
645
|
+
//headers stop at the top of the viewport
|
646
|
+
triggerFloatEvent(true);
|
647
|
+
}
|
648
|
+
left = tableLeftGap;
|
649
|
+
} else if(!locked && useAbsolutePositioning) { //window scrolling, absolute positioning
|
650
|
+
if(windowTop > floatEnd + tableHeight + captionScrollOffset){
|
651
|
+
top = tableHeight - floatContainerHeight + captionScrollOffset; //scrolled past table
|
652
|
+
} else if (tableOffset.top >= windowTop + scrollingTop) {
|
653
|
+
top = 0; //scrolling to table
|
654
|
+
unfloat();
|
655
|
+
triggerFloatEvent(false);
|
656
|
+
} else {
|
657
|
+
top = scrollingTop + windowTop - tableOffset.top + tableContainerGap + (captionAlignTop ? captionHeight : 0);
|
658
|
+
refloat(); //scrolling within table. header floated
|
659
|
+
triggerFloatEvent(true);
|
660
|
+
}
|
661
|
+
left = 0;
|
662
|
+
} else if(locked && !useAbsolutePositioning){ //inner scrolling, fixed positioning
|
663
|
+
if (tableContainerGap > scrollingContainerTop || scrollingContainerTop - tableContainerGap > tableHeight) {
|
664
|
+
top = tableOffset.top - windowTop;
|
665
|
+
unfloat();
|
666
|
+
triggerFloatEvent(false);
|
667
|
+
} else {
|
668
|
+
top = tableOffset.top + scrollingContainerTop - windowTop - tableContainerGap;
|
669
|
+
refloat();
|
670
|
+
triggerFloatEvent(true);
|
671
|
+
//headers stop at the top of the viewport
|
672
|
+
}
|
673
|
+
left = tableOffset.left + scrollContainerLeft - windowLeft;
|
674
|
+
} else if(!locked && !useAbsolutePositioning) { //window scrolling, fixed positioning
|
675
|
+
if(windowTop > floatEnd + tableHeight + captionScrollOffset){
|
676
|
+
top = tableHeight + scrollingTop - windowTop + floatEnd + captionScrollOffset;
|
677
|
+
//scrolled past the bottom of the table
|
678
|
+
} else if (tableOffset.top > windowTop + scrollingTop) {
|
679
|
+
top = tableOffset.top - windowTop;
|
680
|
+
refloat();
|
681
|
+
triggerFloatEvent(false); //this is a weird case, the header never gets unfloated and i have no no way to know
|
682
|
+
//scrolled past the top of the table
|
683
|
+
} else {
|
684
|
+
//scrolling within the table
|
685
|
+
top = scrollingTop;
|
686
|
+
triggerFloatEvent(true);
|
687
|
+
}
|
688
|
+
left = tableOffset.left - windowLeft;
|
689
|
+
}
|
690
|
+
return {top: top, left: left};
|
691
|
+
};
|
692
|
+
}
|
693
|
+
/**
|
694
|
+
* returns a function that caches old floating container position and only updates css when the position changes
|
695
|
+
* @return {Function}
|
696
|
+
*/
|
697
|
+
function repositionFloatContainerFn(){
|
698
|
+
var oldTop = null;
|
699
|
+
var oldLeft = null;
|
700
|
+
var oldScrollLeft = null;
|
701
|
+
return function(pos, setWidth, setHeight){
|
702
|
+
if(pos != null && (oldTop != pos.top || oldLeft != pos.left)){
|
703
|
+
$floatContainer.css({
|
704
|
+
top: pos.top,
|
705
|
+
left: pos.left
|
706
|
+
});
|
707
|
+
oldTop = pos.top;
|
708
|
+
oldLeft = pos.left;
|
709
|
+
}
|
710
|
+
if(setWidth){
|
711
|
+
setFloatWidth();
|
712
|
+
}
|
713
|
+
if(setHeight){
|
714
|
+
setHeaderHeight();
|
715
|
+
}
|
716
|
+
var scrollLeft = $scrollContainer.scrollLeft();
|
717
|
+
if(!useAbsolutePositioning || oldScrollLeft != scrollLeft){
|
718
|
+
$floatContainer.scrollLeft(scrollLeft);
|
719
|
+
oldScrollLeft = scrollLeft;
|
720
|
+
}
|
721
|
+
}
|
722
|
+
}
|
723
|
+
|
724
|
+
/**
|
725
|
+
* checks if THIS table has scrollbars, and finds their widths
|
726
|
+
*/
|
727
|
+
function calculateScrollBarSize(){ //this should happen after the floating table has been positioned
|
728
|
+
if($scrollContainer.length){
|
729
|
+
if($scrollContainer.data().perfectScrollbar){
|
730
|
+
scrollbarOffset = {horizontal:0, vertical:0};
|
731
|
+
} else {
|
732
|
+
var sw = $scrollContainer.width(), sh = $scrollContainer.height(), th = $table.height(), tw = tableWidth($table, $fthCells);
|
733
|
+
var offseth = sw < tw ? scWidth : 0;
|
734
|
+
var offsetv = sh < th ? scWidth : 0;
|
735
|
+
scrollbarOffset.horizontal = sw - offsetv < tw ? scWidth : 0;
|
736
|
+
scrollbarOffset.vertical = sh - offseth < th ? scWidth : 0;
|
737
|
+
}
|
738
|
+
}
|
739
|
+
}
|
740
|
+
//finish up. create all calculation functions and bind them to events
|
741
|
+
calculateScrollBarSize();
|
742
|
+
|
743
|
+
var flow;
|
744
|
+
|
745
|
+
var ensureReflow = function(){
|
746
|
+
flow = reflow();
|
747
|
+
flow();
|
748
|
+
};
|
749
|
+
|
750
|
+
ensureReflow();
|
751
|
+
|
752
|
+
var calculateFloatContainerPos = calculateFloatContainerPosFn();
|
753
|
+
var repositionFloatContainer = repositionFloatContainerFn();
|
754
|
+
|
755
|
+
repositionFloatContainer(calculateFloatContainerPos('init'), true); //this must come after reflow because reflow changes scrollLeft back to 0 when it rips out the thead
|
756
|
+
|
757
|
+
var windowScrollDoneEvent = util.debounce(function(){
|
758
|
+
repositionFloatContainer(calculateFloatContainerPos('windowScrollDone'), false);
|
759
|
+
}, 1);
|
760
|
+
|
761
|
+
var windowScrollEvent = function(){
|
762
|
+
repositionFloatContainer(calculateFloatContainerPos('windowScroll'), false);
|
763
|
+
if(absoluteToFixedOnScroll){
|
764
|
+
windowScrollDoneEvent();
|
765
|
+
}
|
766
|
+
};
|
767
|
+
var containerScrollEvent = function(){
|
768
|
+
repositionFloatContainer(calculateFloatContainerPos('containerScroll'), false);
|
769
|
+
};
|
770
|
+
|
771
|
+
|
772
|
+
var windowResizeEvent = function(){
|
773
|
+
if($table.is(":hidden")){
|
774
|
+
return;
|
775
|
+
}
|
776
|
+
updateScrollingOffsets();
|
777
|
+
calculateScrollBarSize();
|
778
|
+
ensureReflow();
|
779
|
+
calculateFloatContainerPos = calculateFloatContainerPosFn();
|
780
|
+
repositionFloatContainer = repositionFloatContainerFn();
|
781
|
+
repositionFloatContainer(calculateFloatContainerPos('resize'), true, true);
|
782
|
+
};
|
783
|
+
var reflowEvent = util.debounce(function(){
|
784
|
+
if($table.is(":hidden")){
|
785
|
+
return;
|
786
|
+
}
|
787
|
+
calculateScrollBarSize();
|
788
|
+
updateScrollingOffsets();
|
789
|
+
ensureReflow();
|
790
|
+
calculateFloatContainerPos = calculateFloatContainerPosFn();
|
791
|
+
repositionFloatContainer(calculateFloatContainerPos('reflow'), true);
|
792
|
+
}, 1);
|
793
|
+
if(locked){ //internal scrolling
|
794
|
+
if(useAbsolutePositioning){
|
795
|
+
$scrollContainer.on(eventName('scroll'), containerScrollEvent);
|
796
|
+
} else {
|
797
|
+
$scrollContainer.on(eventName('scroll'), containerScrollEvent);
|
798
|
+
$window.on(eventName('scroll'), windowScrollEvent);
|
799
|
+
}
|
800
|
+
} else { //window scrolling
|
801
|
+
$window.on(eventName('scroll'), windowScrollEvent);
|
802
|
+
}
|
803
|
+
|
804
|
+
$window.on(eventName('load'), reflowEvent); //for tables with images
|
805
|
+
|
806
|
+
windowResize(eventName('resize'), windowResizeEvent);
|
807
|
+
$table.on('reflow', reflowEvent);
|
808
|
+
if(isDatatable($table)){
|
809
|
+
$table
|
810
|
+
.on('filter', reflowEvent)
|
811
|
+
.on('sort', reflowEvent)
|
812
|
+
.on('page', reflowEvent);
|
813
|
+
}
|
814
|
+
|
815
|
+
$window.on(eventName('shown.bs.tab'), reflowEvent); // people cant seem to figure out how to use this plugin with bs3 tabs... so this :P
|
816
|
+
$window.on(eventName('tabsactivate'), reflowEvent); // same thing for jqueryui
|
817
|
+
|
818
|
+
|
819
|
+
if (canObserveMutations) {
|
820
|
+
var mutationElement = null;
|
821
|
+
if(util.isFunction(opts.autoReflow)){
|
822
|
+
mutationElement = opts.autoReflow($table, $scrollContainer)
|
823
|
+
}
|
824
|
+
if(!mutationElement) {
|
825
|
+
mutationElement = $scrollContainer.length ? $scrollContainer[0] : $table[0]
|
826
|
+
}
|
827
|
+
mObs = new MutationObserver(function(e){
|
828
|
+
var wasTableRelated = function(nodes){
|
829
|
+
return nodes && nodes[0] && (nodes[0].nodeName == "THEAD" || nodes[0].nodeName == "TD"|| nodes[0].nodeName == "TH");
|
830
|
+
};
|
831
|
+
for(var i=0; i < e.length; i++){
|
832
|
+
if(!(wasTableRelated(e[i].addedNodes) || wasTableRelated(e[i].removedNodes))){
|
833
|
+
reflowEvent();
|
834
|
+
break;
|
835
|
+
}
|
836
|
+
}
|
837
|
+
});
|
838
|
+
mObs.observe(mutationElement, {
|
839
|
+
childList: true,
|
840
|
+
subtree: true
|
841
|
+
});
|
842
|
+
}
|
843
|
+
|
844
|
+
//attach some useful functions to the table.
|
845
|
+
$table.data('floatThead-attached', {
|
846
|
+
destroy: function(){
|
847
|
+
var ns = '.fth-'+floatTheadId;
|
848
|
+
unfloat();
|
849
|
+
$table.css(layoutAuto);
|
850
|
+
$tableColGroup.remove();
|
851
|
+
createElements && $fthGrp.remove();
|
852
|
+
if($newHeader.parent().length){ //only if it's in the DOM
|
853
|
+
$newHeader.replaceWith($header);
|
854
|
+
}
|
855
|
+
if(canObserveMutations){
|
856
|
+
mObs.disconnect();
|
857
|
+
mObs = null;
|
858
|
+
}
|
859
|
+
$table.off('reflow reflowed');
|
860
|
+
$scrollContainer.off(ns);
|
861
|
+
if (wrappedContainer) {
|
862
|
+
if ($scrollContainer.length) {
|
863
|
+
$scrollContainer.unwrap();
|
864
|
+
}
|
865
|
+
else {
|
866
|
+
$table.unwrap();
|
867
|
+
}
|
868
|
+
}
|
869
|
+
if(locked){
|
870
|
+
$scrollContainer.data('floatThead-containerWrap', false);
|
871
|
+
} else {
|
872
|
+
$table.data('floatThead-containerWrap', false);
|
873
|
+
}
|
874
|
+
$table.css('minWidth', originalTableMinWidth);
|
875
|
+
$floatContainer.remove();
|
876
|
+
$table.data('floatThead-attached', false);
|
877
|
+
$window.off(ns);
|
878
|
+
},
|
879
|
+
reflow: function(){
|
880
|
+
reflowEvent();
|
881
|
+
},
|
882
|
+
setHeaderHeight: function(){
|
883
|
+
setHeaderHeight();
|
884
|
+
},
|
885
|
+
getFloatContainer: function(){
|
886
|
+
return $floatContainer;
|
887
|
+
},
|
888
|
+
getRowGroups: function(){
|
889
|
+
if(headerFloated){
|
890
|
+
return $floatContainer.find('>table>thead').add($table.children("tbody,tfoot"));
|
891
|
+
} else {
|
892
|
+
return $table.children("thead,tbody,tfoot");
|
893
|
+
}
|
894
|
+
}
|
895
|
+
});
|
896
|
+
});
|
897
|
+
return this;
|
898
|
+
};
|
899
|
+
})(jQuery);
|