fomantic-ui 2.9.1-beta.8 → 2.9.1
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.
- package/.eslint/eqeqeq-rule.js +18 -0
- package/.eslint/index.js +29 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +123 -0
- package/.github/auto_assign.yml +0 -1
- package/.github/workflows/ci.yml +37 -4
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/.prettierrc.js +12 -0
- package/.stylelintrc.js +48 -0
- package/CHANGELOG.md +112 -0
- package/README.md +1 -1
- package/dist/components/accordion.css +35 -53
- package/dist/components/accordion.js +568 -595
- package/dist/components/accordion.min.css +2 -2
- package/dist/components/accordion.min.js +3 -3
- package/dist/components/ad.css +34 -45
- package/dist/components/ad.min.css +2 -2
- package/dist/components/api.js +1157 -1179
- package/dist/components/api.min.js +3 -3
- package/dist/components/breadcrumb.css +5 -5
- package/dist/components/breadcrumb.min.css +2 -2
- package/dist/components/button.css +709 -1111
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +24 -27
- package/dist/components/calendar.js +1934 -1809
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +3 -3
- package/dist/components/card.css +219 -365
- package/dist/components/card.min.css +2 -2
- package/dist/components/checkbox.css +120 -191
- package/dist/components/checkbox.js +842 -841
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +3 -3
- package/dist/components/comment.css +41 -59
- package/dist/components/comment.min.css +2 -2
- package/dist/components/container.css +7 -6
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +53 -172
- package/dist/components/dimmer.js +706 -737
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +3 -3
- package/dist/components/divider.css +43 -61
- package/dist/components/divider.min.css +2 -2
- package/dist/components/dropdown.css +252 -386
- package/dist/components/dropdown.js +4195 -4236
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +3 -3
- package/dist/components/embed.css +18 -29
- package/dist/components/embed.js +645 -675
- package/dist/components/embed.min.css +2 -2
- package/dist/components/embed.min.js +3 -3
- package/dist/components/emoji.css +3556 -3556
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +35 -57
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +270 -268
- package/dist/components/flag.min.css +2 -2
- package/dist/components/flyout.css +95 -141
- package/dist/components/flyout.js +1514 -1465
- package/dist/components/flyout.min.css +2 -2
- package/dist/components/flyout.min.js +3 -3
- package/dist/components/form.css +244 -339
- package/dist/components/form.js +2022 -2004
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +3 -3
- package/dist/components/grid.css +183 -329
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +118 -142
- package/dist/components/header.min.css +2 -2
- package/dist/components/icon.css +662 -745
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +39 -63
- package/dist/components/image.min.css +2 -2
- package/dist/components/input.css +356 -274
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +84 -131
- package/dist/components/item.min.css +2 -2
- package/dist/components/label.css +359 -410
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +49 -70
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +67 -155
- package/dist/components/loader.min.css +2 -2
- package/dist/components/menu.css +270 -431
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +125 -197
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +120 -154
- package/dist/components/modal.js +1544 -1486
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +3 -3
- package/dist/components/nag.css +53 -63
- package/dist/components/nag.js +520 -526
- package/dist/components/nag.min.css +2 -2
- package/dist/components/nag.min.js +3 -3
- package/dist/components/placeholder.css +22 -42
- package/dist/components/placeholder.min.css +2 -2
- package/dist/components/popup.css +424 -202
- package/dist/components/popup.js +1456 -1456
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +3 -3
- package/dist/components/progress.css +106 -211
- package/dist/components/progress.js +969 -997
- package/dist/components/progress.min.css +2 -2
- package/dist/components/progress.min.js +3 -3
- package/dist/components/rail.css +15 -20
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +80 -121
- package/dist/components/rating.js +507 -523
- package/dist/components/rating.min.css +2 -2
- package/dist/components/rating.min.js +3 -3
- package/dist/components/reset.css +8 -13
- package/dist/components/reset.min.css +2 -2
- package/dist/components/reveal.css +44 -83
- package/dist/components/reveal.min.css +2 -2
- package/dist/components/search.css +69 -98
- package/dist/components/search.js +1520 -1534
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +3 -3
- package/dist/components/segment.css +148 -224
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +14 -30
- package/dist/components/shape.js +783 -810
- package/dist/components/shape.min.css +2 -2
- package/dist/components/shape.min.js +3 -3
- package/dist/components/sidebar.css +103 -206
- package/dist/components/sidebar.js +1061 -1099
- package/dist/components/sidebar.min.css +2 -2
- package/dist/components/sidebar.min.js +3 -3
- package/dist/components/site.css +28 -41
- package/dist/components/site.js +436 -476
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +3 -3
- package/dist/components/slider.css +93 -121
- package/dist/components/slider.js +1310 -1311
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +3 -3
- package/dist/components/state.js +638 -657
- package/dist/components/state.min.js +3 -3
- package/dist/components/statistic.css +75 -116
- package/dist/components/statistic.min.css +2 -2
- package/dist/components/step.css +77 -150
- package/dist/components/step.min.css +2 -2
- package/dist/components/sticky.css +1 -5
- package/dist/components/sticky.js +847 -901
- package/dist/components/sticky.min.css +2 -2
- package/dist/components/sticky.min.js +3 -3
- package/dist/components/tab.css +10 -14
- package/dist/components/tab.js +902 -966
- package/dist/components/tab.min.css +2 -2
- package/dist/components/tab.min.js +3 -3
- package/dist/components/table.css +547 -774
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +32 -32
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +69 -147
- package/dist/components/toast.js +910 -884
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +3 -3
- package/dist/components/transition.css +299 -1356
- package/dist/components/transition.js +1048 -1077
- package/dist/components/transition.min.css +2 -2
- package/dist/components/transition.min.js +3 -3
- package/dist/components/visibility.js +1213 -1245
- package/dist/components/visibility.min.js +3 -3
- package/dist/semantic.css +9344 -12298
- package/dist/semantic.js +29181 -29423
- package/dist/semantic.min.css +3 -3
- package/dist/semantic.min.js +3 -3
- package/dist/themes/basic/assets/fonts/icons.woff2 +0 -0
- package/dist/themes/github/assets/fonts/octicons.woff2 +0 -0
- package/examples/.eslintrc.js +6 -0
- package/examples/assets/library/jquery.min.js +2 -4
- package/examples/assets/show-examples.js +13 -13
- package/examples/attached.html +1 -1
- package/examples/bootstrap.html +1 -1
- package/examples/components/button.html +1 -1
- package/examples/components/card.html +6 -6
- package/examples/components/input.html +1 -1
- package/examples/components/menu.html +1 -1
- package/examples/components/site.html +1 -1
- package/examples/components/sticky-context.html +2 -2
- package/examples/components/table.html +1 -1
- package/examples/fixed.html +3 -3
- package/examples/grid.html +5 -5
- package/examples/homepage.html +1 -1
- package/examples/login.html +2 -2
- package/examples/responsive.html +2 -2
- package/examples/sticky.html +4 -4
- package/examples/theming.html +1 -1
- package/gulpfile.js +13 -11
- package/package.json +17 -8
- package/scripts/nightly-version.js +83 -75
- package/src/_site/collections/menu.overrides +1 -1
- package/src/_site/elements/flag.variables +2 -2
- package/src/_site/globals/site.variables +1 -1
- package/src/_site/modules/embed.variables +3 -0
- package/src/definitions/behaviors/api.js +1158 -1180
- package/src/definitions/behaviors/form.js +2021 -2003
- package/src/definitions/behaviors/state.js +644 -663
- package/src/definitions/behaviors/visibility.js +1212 -1244
- package/src/definitions/collections/breadcrumb.less +43 -47
- package/src/definitions/collections/form.less +866 -884
- package/src/definitions/collections/grid.less +1681 -1699
- package/src/definitions/collections/menu.less +1522 -1544
- package/src/definitions/collections/message.less +294 -298
- package/src/definitions/collections/table.less +1657 -1661
- package/src/definitions/elements/button.less +1716 -1750
- package/src/definitions/elements/container.less +211 -211
- package/src/definitions/elements/divider.less +198 -211
- package/src/definitions/elements/emoji.less +41 -48
- package/src/definitions/elements/flag.less +46 -48
- package/src/definitions/elements/header.less +351 -359
- package/src/definitions/elements/icon.less +541 -484
- package/src/definitions/elements/image.less +216 -227
- package/src/definitions/elements/input.less +692 -699
- package/src/definitions/elements/label.less +784 -806
- package/src/definitions/elements/list.less +810 -814
- package/src/definitions/elements/loader.less +273 -268
- package/src/definitions/elements/placeholder.less +173 -170
- package/src/definitions/elements/rail.less +93 -93
- package/src/definitions/elements/reveal.less +192 -198
- package/src/definitions/elements/segment.less +742 -749
- package/src/definitions/elements/step.less +423 -437
- package/src/definitions/elements/text.less +34 -36
- package/src/definitions/globals/reset.less +11 -8
- package/src/definitions/globals/site.js +435 -475
- package/src/definitions/globals/site.less +108 -110
- package/src/definitions/modules/accordion.js +567 -594
- package/src/definitions/modules/accordion.less +244 -248
- package/src/definitions/modules/calendar.js +1933 -1808
- package/src/definitions/modules/calendar.less +100 -97
- package/src/definitions/modules/checkbox.js +841 -840
- package/src/definitions/modules/checkbox.less +531 -552
- package/src/definitions/modules/dimmer.js +705 -736
- package/src/definitions/modules/dimmer.less +294 -305
- package/src/definitions/modules/dropdown.js +4194 -4235
- package/src/definitions/modules/dropdown.less +1568 -1598
- package/src/definitions/modules/embed.js +644 -674
- package/src/definitions/modules/embed.less +82 -84
- package/src/definitions/modules/flyout.js +1513 -1464
- package/src/definitions/modules/flyout.less +453 -455
- package/src/definitions/modules/modal.js +1543 -1485
- package/src/definitions/modules/modal.less +459 -467
- package/src/definitions/modules/nag.js +519 -525
- package/src/definitions/modules/nag.less +136 -149
- package/src/definitions/modules/popup.js +1455 -1455
- package/src/definitions/modules/popup.less +738 -693
- package/src/definitions/modules/progress.js +968 -996
- package/src/definitions/modules/progress.less +523 -499
- package/src/definitions/modules/rating.js +506 -522
- package/src/definitions/modules/rating.less +98 -103
- package/src/definitions/modules/search.js +1519 -1533
- package/src/definitions/modules/search.less +374 -394
- package/src/definitions/modules/shape.js +782 -809
- package/src/definitions/modules/shape.less +70 -79
- package/src/definitions/modules/sidebar.js +1060 -1098
- package/src/definitions/modules/sidebar.less +463 -476
- package/src/definitions/modules/slider.js +1309 -1310
- package/src/definitions/modules/slider.less +309 -310
- package/src/definitions/modules/sticky.js +863 -917
- package/src/definitions/modules/sticky.less +17 -25
- package/src/definitions/modules/tab.js +901 -965
- package/src/definitions/modules/tab.less +48 -54
- package/src/definitions/modules/toast.js +909 -883
- package/src/definitions/modules/toast.less +589 -589
- package/src/definitions/modules/transition.js +1047 -1076
- package/src/definitions/modules/transition.less +58 -59
- package/src/definitions/views/ad.less +207 -208
- package/src/definitions/views/card.less +955 -973
- package/src/definitions/views/comment.less +192 -200
- package/src/definitions/views/feed.less +222 -226
- package/src/definitions/views/item.less +437 -448
- package/src/definitions/views/statistic.less +273 -279
- package/src/semantic.less +8 -6
- package/src/theme.config.example +53 -53
- package/src/theme.less +44 -35
- package/src/themes/amazon/elements/button.overrides +23 -24
- package/src/themes/amazon/elements/button.variables +18 -23
- package/src/themes/amazon/globals/site.variables +16 -17
- package/src/themes/basic/assets/fonts/icons.woff2 +0 -0
- package/src/themes/basic/collections/table.overrides +0 -1
- package/src/themes/basic/collections/table.variables +3 -3
- package/src/themes/basic/elements/button.overrides +0 -1
- package/src/themes/basic/elements/button.variables +9 -9
- package/src/themes/basic/elements/icon.overrides +9 -169
- package/src/themes/basic/elements/icon.variables +161 -18
- package/src/themes/basic/elements/step.overrides +2 -2
- package/src/themes/basic/elements/step.variables +2 -2
- package/src/themes/basic/globals/reset.overrides +1 -1
- package/src/themes/basic/globals/reset.variables +1 -1
- package/src/themes/basic/modules/progress.variables +2 -2
- package/src/themes/basic/views/card.overrides +0 -1
- package/src/themes/basic/views/card.variables +6 -6
- package/src/themes/bookish/elements/header.overrides +4 -4
- package/src/themes/bookish/elements/header.variables +5 -5
- package/src/themes/bootstrap3/elements/button.overrides +3 -0
- package/src/themes/bootstrap3/elements/button.variables +20 -25
- package/src/themes/chubby/collections/form.overrides +9 -9
- package/src/themes/chubby/collections/form.variables +3 -3
- package/src/themes/chubby/collections/menu.overrides +3 -0
- package/src/themes/chubby/collections/menu.variables +3 -3
- package/src/themes/chubby/elements/button.overrides +8 -10
- package/src/themes/chubby/elements/button.variables +10 -10
- package/src/themes/chubby/elements/header.overrides +1 -1
- package/src/themes/chubby/elements/header.variables +4 -4
- package/src/themes/chubby/modules/accordion.overrides +2 -2
- package/src/themes/chubby/modules/accordion.variables +4 -4
- package/src/themes/chubby/views/comment.overrides +5 -5
- package/src/themes/chubby/views/comment.variables +11 -11
- package/src/themes/classic/collections/table.variables +3 -3
- package/src/themes/classic/elements/button.variables +36 -43
- package/src/themes/classic/elements/header.variables +4 -4
- package/src/themes/classic/modules/progress.variables +3 -3
- package/src/themes/classic/views/card.overrides +25 -27
- package/src/themes/classic/views/card.variables +7 -7
- package/src/themes/colored/modules/checkbox.overrides +3 -0
- package/src/themes/colored/modules/checkbox.variables +1 -3
- package/src/themes/default/collections/breadcrumb.variables +4 -4
- package/src/themes/default/collections/form.variables +15 -16
- package/src/themes/default/collections/grid.overrides +0 -1
- package/src/themes/default/collections/grid.variables +15 -16
- package/src/themes/default/collections/menu.variables +31 -45
- package/src/themes/default/collections/message.variables +84 -123
- package/src/themes/default/collections/table.overrides +3 -0
- package/src/themes/default/collections/table.variables +30 -34
- package/src/themes/default/elements/button.variables +44 -53
- package/src/themes/default/elements/container.variables +8 -16
- package/src/themes/default/elements/divider.overrides +8 -9
- package/src/themes/default/elements/divider.variables +5 -6
- package/src/themes/default/elements/emoji.overrides +0 -1
- package/src/themes/default/elements/emoji.variables +3556 -3556
- package/src/themes/default/elements/flag.variables +1595 -1595
- package/src/themes/default/elements/header.overrides +0 -1
- package/src/themes/default/elements/header.variables +21 -21
- package/src/themes/default/elements/icon.variables +2016 -2012
- package/src/themes/default/elements/image.variables +6 -7
- package/src/themes/default/elements/input.variables +11 -12
- package/src/themes/default/elements/label.variables +25 -26
- package/src/themes/default/elements/list.variables +17 -21
- package/src/themes/default/elements/loader.variables +16 -17
- package/src/themes/default/elements/placeholder.variables +12 -9
- package/src/themes/default/elements/rail.variables +4 -5
- package/src/themes/default/elements/reveal.variables +1 -1
- package/src/themes/default/elements/segment.variables +24 -36
- package/src/themes/default/elements/step.overrides +4 -4
- package/src/themes/default/elements/step.variables +19 -22
- package/src/themes/default/elements/text.variables +2 -3
- package/src/themes/default/globals/colors.less +588 -588
- package/src/themes/default/globals/reset.overrides +63 -59
- package/src/themes/default/globals/reset.variables +1 -1
- package/src/themes/default/globals/site.variables +1074 -1123
- package/src/themes/default/globals/variation.variables +6 -4
- package/src/themes/default/modules/accordion.overrides +11 -11
- package/src/themes/default/modules/accordion.variables +15 -20
- package/src/themes/default/modules/calendar.variables +2 -0
- package/src/themes/default/modules/chatroom.variables +1 -1
- package/src/themes/default/modules/checkbox.overrides +9 -13
- package/src/themes/default/modules/checkbox.variables +24 -33
- package/src/themes/default/modules/dimmer.variables +14 -17
- package/src/themes/default/modules/dropdown.overrides +17 -17
- package/src/themes/default/modules/dropdown.variables +29 -31
- package/src/themes/default/modules/embed.variables +9 -13
- package/src/themes/default/modules/flyout.variables +10 -8
- package/src/themes/default/modules/modal.variables +64 -67
- package/src/themes/default/modules/nag.variables +11 -14
- package/src/themes/default/modules/popup.variables +14 -13
- package/src/themes/default/modules/progress.variables +17 -19
- package/src/themes/default/modules/rating.variables +10 -12
- package/src/themes/default/modules/search.variables +12 -17
- package/src/themes/default/modules/shape.variables +7 -8
- package/src/themes/default/modules/sidebar.variables +4 -4
- package/src/themes/default/modules/slider.variables +55 -54
- package/src/themes/default/modules/sticky.variables +1 -1
- package/src/themes/default/modules/toast.variables +8 -8
- package/src/themes/default/modules/transition.overrides +936 -915
- package/src/themes/default/modules/transition.variables +1 -1
- package/src/themes/default/views/ad.variables +1 -1
- package/src/themes/default/views/card.variables +33 -45
- package/src/themes/default/views/comment.variables +7 -9
- package/src/themes/default/views/feed.variables +10 -10
- package/src/themes/default/views/item.variables +20 -23
- package/src/themes/default/views/statistic.variables +8 -8
- package/src/themes/duo/elements/loader.variables +1 -1
- package/src/themes/famfamfam/elements/flag.overrides +263 -268
- package/src/themes/famfamfam/elements/flag.variables +4 -4
- package/src/themes/fixed-width/collections/grid.variables +4 -4
- package/src/themes/fixed-width/modules/modal.variables +11 -13
- package/src/themes/flat/collections/form.overrides +9 -9
- package/src/themes/flat/collections/form.variables +16 -17
- package/src/themes/flat/globals/site.variables +69 -74
- package/src/themes/github/assets/fonts/octicons.woff2 +0 -0
- package/src/themes/github/collections/breadcrumb.variables +0 -1
- package/src/themes/github/collections/form.overrides +7 -8
- package/src/themes/github/collections/form.variables +16 -18
- package/src/themes/github/collections/grid.variables +1 -2
- package/src/themes/github/collections/menu.overrides +2 -2
- package/src/themes/github/collections/menu.variables +24 -26
- package/src/themes/github/collections/message.overrides +3 -3
- package/src/themes/github/collections/message.variables +12 -14
- package/src/themes/github/collections/table.variables +2 -2
- package/src/themes/github/elements/button.overrides +0 -1
- package/src/themes/github/elements/button.variables +26 -30
- package/src/themes/github/elements/header.variables +2 -2
- package/src/themes/github/elements/icon.overrides +3 -208
- package/src/themes/github/elements/icon.variables +234 -19
- package/src/themes/github/elements/image.variables +1 -1
- package/src/themes/github/elements/input.overrides +16 -16
- package/src/themes/github/elements/input.variables +4 -5
- package/src/themes/github/elements/label.overrides +3 -3
- package/src/themes/github/elements/label.variables +0 -1
- package/src/themes/github/elements/segment.variables +9 -10
- package/src/themes/github/elements/step.overrides +13 -13
- package/src/themes/github/elements/step.variables +6 -6
- package/src/themes/github/globals/site.variables +16 -16
- package/src/themes/github/modules/dropdown.overrides +18 -19
- package/src/themes/github/modules/dropdown.variables +8 -10
- package/src/themes/github/modules/popup.variables +0 -2
- package/src/themes/gmail/collections/message.overrides +3 -0
- package/src/themes/gmail/collections/message.variables +4 -4
- package/src/themes/instagram/views/card.overrides +4 -5
- package/src/themes/instagram/views/card.variables +7 -8
- package/src/themes/joypixels/elements/emoji.overrides +0 -2
- package/src/themes/joypixels/elements/emoji.variables +3554 -3554
- package/src/themes/material/collections/menu.overrides +1 -1
- package/src/themes/material/collections/menu.variables +4 -4
- package/src/themes/material/elements/button.overrides +7 -9
- package/src/themes/material/elements/button.variables +44 -46
- package/src/themes/material/elements/header.overrides +3 -3
- package/src/themes/material/elements/header.variables +8 -10
- package/src/themes/material/elements/icon.overrides +3 -934
- package/src/themes/material/elements/icon.variables +958 -18
- package/src/themes/material/globals/site.overrides +3 -0
- package/src/themes/material/globals/site.variables +83 -84
- package/src/themes/material/modules/dropdown.overrides +2 -2
- package/src/themes/material/modules/dropdown.variables +5 -5
- package/src/themes/material/modules/modal.overrides +3 -3
- package/src/themes/material/modules/modal.variables +4 -5
- package/src/themes/pulsar/elements/loader.overrides +23 -61
- package/src/themes/raised/elements/button.variables +8 -9
- package/src/themes/resetcss/globals/reset.overrides +115 -33
- package/src/themes/resetcss/globals/reset.variables +1 -1
- package/src/themes/round/elements/button.overrides +3 -0
- package/src/themes/round/elements/button.variables +33 -38
- package/src/themes/rtl/globals/site.overrides +1 -1
- package/src/themes/rtl/globals/site.variables +5 -6
- package/src/themes/striped/modules/progress.overrides +20 -16
- package/src/themes/systemfont/globals/reset.overrides +1 -1
- package/src/themes/systemfont/globals/site.variables +6 -6
- package/src/themes/timeline/views/feed.overrides +12 -12
- package/src/themes/timeline/views/feed.variables +8 -8
- package/src/themes/twitter/elements/button.overrides +4 -5
- package/src/themes/twitter/elements/button.variables +17 -18
- package/src/themes/twitter/elements/emoji.variables +3556 -3556
- package/tasks/.eslintrc.js +9 -0
- package/tasks/README.md +2 -4
- package/tasks/admin/components/create.js +268 -277
- package/tasks/admin/components/init.js +123 -129
- package/tasks/admin/components/update.js +151 -158
- package/tasks/admin/distributions/create.js +183 -189
- package/tasks/admin/distributions/init.js +125 -131
- package/tasks/admin/distributions/update.js +147 -153
- package/tasks/admin/publish.js +5 -9
- package/tasks/admin/register.js +37 -39
- package/tasks/admin/release.js +8 -12
- package/tasks/build/assets.js +43 -40
- package/tasks/build/css.js +230 -217
- package/tasks/build/javascript.js +120 -114
- package/tasks/build.js +11 -11
- package/tasks/check-install.js +15 -17
- package/tasks/clean.js +6 -6
- package/tasks/collections/README.md +3 -5
- package/tasks/collections/admin.js +34 -36
- package/tasks/collections/build.js +19 -21
- package/tasks/collections/docs.js +11 -13
- package/tasks/collections/install.js +11 -13
- package/tasks/collections/rtl.js +9 -12
- package/tasks/collections/various.js +10 -12
- package/tasks/config/admin/github.js +17 -19
- package/tasks/config/admin/oauth.example.js +4 -4
- package/tasks/config/admin/release.js +98 -98
- package/tasks/config/admin/templates/README.md +8 -8
- package/tasks/config/admin/templates/bower.json +3 -2
- package/tasks/config/admin/templates/component-package.js +9 -10
- package/tasks/config/admin/templates/css-package.js +19 -21
- package/tasks/config/admin/templates/less-package.js +12 -14
- package/tasks/config/admin/templates/package.json +6 -6
- package/tasks/config/defaults.js +116 -116
- package/tasks/config/docs.js +23 -23
- package/tasks/config/npm/gulpfile.js +15 -14
- package/tasks/config/project/config.js +124 -136
- package/tasks/config/project/install.js +722 -719
- package/tasks/config/project/release.js +34 -41
- package/tasks/config/tasks.js +168 -167
- package/tasks/config/user.js +28 -32
- package/tasks/docs/build.js +100 -96
- package/tasks/docs/metadata.js +91 -98
- package/tasks/docs/serve.js +84 -82
- package/tasks/install.js +373 -382
- package/tasks/rtl/build.js +4 -3
- package/tasks/rtl/watch.js +4 -3
- package/tasks/version.js +4 -6
- package/tasks/watch.js +29 -31
- package/test/.eslintrc.js +23 -0
- package/test/meteor/assets.js +11 -14
- package/test/meteor/fonts.js +12 -13
- package/test/modules/accordion.spec.js +6 -8
- package/test/modules/checkbox.spec.js +5 -7
- package/test/modules/dropdown.spec.js +5 -7
- package/test/modules/modal.spec.js +6 -8
- package/test/modules/module.spec.js +158 -178
- package/test/modules/popup.spec.js +5 -7
- package/test/modules/search.spec.js +5 -7
- package/test/modules/shape.spec.js +5 -7
- package/test/modules/sidebar.spec.js +5 -7
- package/test/modules/tab.spec.js +6 -8
- package/test/modules/transition.spec.js +5 -7
- package/test/modules/video.spec.js +5 -7
- package/.github/workflows/codeql.yml +0 -68
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1
|
2
|
+
* # Fomantic-UI 2.9.1 - Sticky
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -8,961 +8,907 @@
|
|
8
8
|
*
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
11
|
+
(function ($, window, document) {
|
12
|
+
'use strict';
|
12
13
|
|
13
|
-
|
14
|
+
function isFunction(obj) {
|
15
|
+
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
|
+
}
|
14
17
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
|
+
? window
|
20
|
+
: globalThis;
|
18
21
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
;
|
22
|
+
$.fn.sticky = function (parameters) {
|
23
|
+
var
|
24
|
+
$allModules = $(this),
|
25
|
+
$document = $(document),
|
26
|
+
moduleSelector = $allModules.selector || '',
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
$allModules = $(this),
|
29
|
-
moduleSelector = $allModules.selector || '',
|
28
|
+
time = Date.now(),
|
29
|
+
performance = [],
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
query = arguments[0],
|
32
|
+
methodInvoked = typeof query === 'string',
|
33
|
+
queryArguments = [].slice.call(arguments, 1),
|
34
|
+
returnedValue
|
35
|
+
;
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
$allModules
|
41
|
-
.each(function() {
|
42
|
-
var
|
43
|
-
settings = ( $.isPlainObject(parameters) )
|
44
|
-
? $.extend(true, {}, $.fn.sticky.settings, parameters)
|
45
|
-
: $.extend({}, $.fn.sticky.settings),
|
37
|
+
$allModules.each(function () {
|
38
|
+
var
|
39
|
+
settings = $.isPlainObject(parameters)
|
40
|
+
? $.extend(true, {}, $.fn.sticky.settings, parameters)
|
41
|
+
: $.extend({}, $.fn.sticky.settings),
|
46
42
|
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
className = settings.className,
|
44
|
+
namespace = settings.namespace,
|
45
|
+
error = settings.error,
|
50
46
|
|
51
|
-
|
52
|
-
|
47
|
+
eventNamespace = '.' + namespace,
|
48
|
+
moduleNamespace = 'module-' + namespace,
|
53
49
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
$module = $(this),
|
51
|
+
$window = $(window),
|
52
|
+
$scroll = [window, document].indexOf(settings.scrollContext) < 0 ? $document.find(settings.scrollContext) : $(settings.scrollContext),
|
53
|
+
$container,
|
54
|
+
$context,
|
59
55
|
|
60
|
-
|
56
|
+
instance = $module.data(moduleNamespace),
|
61
57
|
|
62
|
-
|
63
|
-
|| window.mozRequestAnimationFrame
|
64
|
-
|| window.webkitRequestAnimationFrame
|
65
|
-
|| window.msRequestAnimationFrame
|
66
|
-
|| function(callback) { setTimeout(callback, 0); },
|
58
|
+
element = this,
|
67
59
|
|
68
|
-
|
60
|
+
documentObserver,
|
61
|
+
observer,
|
62
|
+
module
|
63
|
+
;
|
69
64
|
|
70
|
-
|
71
|
-
observer,
|
72
|
-
module
|
73
|
-
;
|
65
|
+
module = {
|
74
66
|
|
75
|
-
|
67
|
+
initialize: function () {
|
68
|
+
module.determineContainer();
|
69
|
+
module.determineContext();
|
70
|
+
module.verbose('Initializing sticky', settings, $container);
|
76
71
|
|
77
|
-
|
72
|
+
module.save.positions();
|
73
|
+
module.checkErrors();
|
74
|
+
module.bind.events();
|
78
75
|
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
if (settings.observeChanges) {
|
77
|
+
module.observeChanges();
|
78
|
+
}
|
79
|
+
module.instantiate();
|
80
|
+
},
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
82
|
+
instantiate: function () {
|
83
|
+
module.verbose('Storing instance of module', module);
|
84
|
+
instance = module;
|
85
|
+
$module
|
86
|
+
.data(moduleNamespace, module)
|
87
|
+
;
|
88
|
+
},
|
86
89
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
90
|
+
destroy: function () {
|
91
|
+
module.verbose('Destroying previous instance');
|
92
|
+
module.reset();
|
93
|
+
if (documentObserver) {
|
94
|
+
documentObserver.disconnect();
|
95
|
+
}
|
96
|
+
if (observer) {
|
97
|
+
observer.disconnect();
|
98
|
+
}
|
99
|
+
$window
|
100
|
+
.off('load' + eventNamespace, module.event.load)
|
101
|
+
.off('resize' + eventNamespace, module.event.resize)
|
102
|
+
;
|
103
|
+
$scroll
|
104
|
+
.off('scrollchange' + eventNamespace, module.event.scrollchange)
|
105
|
+
;
|
106
|
+
$module.removeData(moduleNamespace);
|
107
|
+
},
|
92
108
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
109
|
+
observeChanges: function () {
|
110
|
+
if ('MutationObserver' in window) {
|
111
|
+
documentObserver = new MutationObserver(module.event.documentChanged);
|
112
|
+
observer = new MutationObserver(module.event.changed);
|
113
|
+
documentObserver.observe(document, {
|
114
|
+
childList: true,
|
115
|
+
subtree: true,
|
116
|
+
});
|
117
|
+
observer.observe(element, {
|
118
|
+
childList: true,
|
119
|
+
subtree: true,
|
120
|
+
});
|
121
|
+
observer.observe($context[0], {
|
122
|
+
childList: true,
|
123
|
+
subtree: true,
|
124
|
+
});
|
125
|
+
module.debug('Setting up mutation observer', observer);
|
126
|
+
}
|
127
|
+
},
|
100
128
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
observer.disconnect();
|
109
|
-
}
|
110
|
-
$window
|
111
|
-
.off('load' + eventNamespace, module.event.load)
|
112
|
-
.off('resize' + eventNamespace, module.event.resize)
|
113
|
-
;
|
114
|
-
$scroll
|
115
|
-
.off('scrollchange' + eventNamespace, module.event.scrollchange)
|
116
|
-
;
|
117
|
-
$module.removeData(moduleNamespace);
|
118
|
-
},
|
129
|
+
determineContainer: function () {
|
130
|
+
if (settings.container) {
|
131
|
+
$container = [window, document].indexOf(settings.container) < 0 ? $document.find(settings.container) : $(settings.container);
|
132
|
+
} else {
|
133
|
+
$container = $module.offsetParent();
|
134
|
+
}
|
135
|
+
},
|
119
136
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
subtree : true
|
131
|
-
});
|
132
|
-
observer.observe($context[0], {
|
133
|
-
childList : true,
|
134
|
-
subtree : true
|
135
|
-
});
|
136
|
-
module.debug('Setting up mutation observer', observer);
|
137
|
-
}
|
138
|
-
},
|
137
|
+
determineContext: function () {
|
138
|
+
if (settings.context) {
|
139
|
+
$context = [window, document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $(settings.context);
|
140
|
+
} else {
|
141
|
+
$context = $container;
|
142
|
+
}
|
143
|
+
if ($context.length === 0) {
|
144
|
+
module.error(error.invalidContext, settings.context, $module);
|
145
|
+
}
|
146
|
+
},
|
139
147
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
+
checkErrors: function () {
|
149
|
+
if (module.is.hidden()) {
|
150
|
+
module.error(error.visible, $module);
|
151
|
+
}
|
152
|
+
if (module.cache.element.height > module.cache.context.height) {
|
153
|
+
module.reset();
|
154
|
+
module.error(error.elementSize, $module);
|
155
|
+
}
|
156
|
+
},
|
148
157
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
158
|
+
bind: {
|
159
|
+
events: function () {
|
160
|
+
$window
|
161
|
+
.on('load' + eventNamespace, module.event.load)
|
162
|
+
.on('resize' + eventNamespace, module.event.resize)
|
163
|
+
;
|
164
|
+
// pub/sub pattern
|
165
|
+
$scroll
|
166
|
+
.off('scroll' + eventNamespace)
|
167
|
+
.on('scroll' + eventNamespace, module.event.scroll)
|
168
|
+
.on('scrollchange' + eventNamespace, module.event.scrollchange)
|
169
|
+
;
|
170
|
+
},
|
171
|
+
},
|
160
172
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
173
|
+
event: {
|
174
|
+
changed: function (mutations) {
|
175
|
+
clearTimeout(module.timer);
|
176
|
+
module.timer = setTimeout(function () {
|
177
|
+
module.verbose('DOM tree modified, updating sticky menu', mutations);
|
178
|
+
module.refresh();
|
179
|
+
}, 100);
|
180
|
+
},
|
181
|
+
documentChanged: function (mutations) {
|
182
|
+
[].forEach.call(mutations, function (mutation) {
|
183
|
+
if (mutation.removedNodes) {
|
184
|
+
[].forEach.call(mutation.removedNodes, function (node) {
|
185
|
+
if (node === element || $(node).find(element).length > 0) {
|
186
|
+
module.debug('Element removed from DOM, tearing down events');
|
187
|
+
module.destroy();
|
188
|
+
}
|
189
|
+
});
|
190
|
+
}
|
191
|
+
});
|
192
|
+
},
|
193
|
+
load: function () {
|
194
|
+
module.verbose('Page contents finished loading');
|
195
|
+
requestAnimationFrame(module.refresh);
|
196
|
+
},
|
197
|
+
resize: function () {
|
198
|
+
module.verbose('Window resized');
|
199
|
+
requestAnimationFrame(module.refresh);
|
200
|
+
},
|
201
|
+
scroll: function () {
|
202
|
+
requestAnimationFrame(function () {
|
203
|
+
$scroll.triggerHandler('scrollchange' + eventNamespace, $scroll.scrollTop());
|
204
|
+
});
|
205
|
+
},
|
206
|
+
scrollchange: function (event, scrollPosition) {
|
207
|
+
module.stick(scrollPosition);
|
208
|
+
settings.onScroll.call(element);
|
209
|
+
},
|
210
|
+
},
|
170
211
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
}
|
184
|
-
},
|
212
|
+
refresh: function (hardRefresh) {
|
213
|
+
module.reset();
|
214
|
+
if (!settings.context) {
|
215
|
+
module.determineContext();
|
216
|
+
}
|
217
|
+
if (hardRefresh) {
|
218
|
+
module.determineContainer();
|
219
|
+
}
|
220
|
+
module.save.positions();
|
221
|
+
module.stick();
|
222
|
+
settings.onReposition.call(element);
|
223
|
+
},
|
185
224
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
}, 100);
|
193
|
-
},
|
194
|
-
documentChanged: function(mutations) {
|
195
|
-
[].forEach.call(mutations, function(mutation) {
|
196
|
-
if(mutation.removedNodes) {
|
197
|
-
[].forEach.call(mutation.removedNodes, function(node) {
|
198
|
-
if(node == element || $(node).find(element).length > 0) {
|
199
|
-
module.debug('Element removed from DOM, tearing down events');
|
200
|
-
module.destroy();
|
201
|
-
}
|
202
|
-
});
|
203
|
-
}
|
204
|
-
});
|
205
|
-
},
|
206
|
-
load: function() {
|
207
|
-
module.verbose('Page contents finished loading');
|
208
|
-
requestAnimationFrame(module.refresh);
|
209
|
-
},
|
210
|
-
resize: function() {
|
211
|
-
module.verbose('Window resized');
|
212
|
-
requestAnimationFrame(module.refresh);
|
213
|
-
},
|
214
|
-
scroll: function() {
|
215
|
-
requestAnimationFrame(function() {
|
216
|
-
$scroll.triggerHandler('scrollchange' + eventNamespace, $scroll.scrollTop() );
|
217
|
-
});
|
218
|
-
},
|
219
|
-
scrollchange: function(event, scrollPosition) {
|
220
|
-
module.stick(scrollPosition);
|
221
|
-
settings.onScroll.call(element);
|
222
|
-
}
|
223
|
-
},
|
225
|
+
supports: {
|
226
|
+
sticky: function () {
|
227
|
+
var
|
228
|
+
$element = $('<div/>')
|
229
|
+
;
|
230
|
+
$element.addClass(className.supported);
|
224
231
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
module.determineContext();
|
229
|
-
}
|
230
|
-
if(hardRefresh) {
|
231
|
-
module.determineContainer();
|
232
|
-
}
|
233
|
-
module.save.positions();
|
234
|
-
module.stick();
|
235
|
-
settings.onReposition.call(element);
|
236
|
-
},
|
232
|
+
return $element.css('position').match('sticky');
|
233
|
+
},
|
234
|
+
},
|
237
235
|
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
236
|
+
save: {
|
237
|
+
lastScroll: function (scroll) {
|
238
|
+
module.lastScroll = scroll;
|
239
|
+
},
|
240
|
+
elementScroll: function (scroll) {
|
241
|
+
module.elementScroll = scroll;
|
242
|
+
},
|
243
|
+
positions: function () {
|
244
|
+
var
|
245
|
+
scrollContext = {
|
246
|
+
height: $scroll.height(),
|
247
|
+
},
|
248
|
+
element = {
|
249
|
+
margin: {
|
250
|
+
top: parseInt($module.css('margin-top'), 10),
|
251
|
+
bottom: parseInt($module.css('margin-bottom'), 10),
|
252
|
+
},
|
253
|
+
offset: $module.offset(),
|
254
|
+
width: $module.outerWidth(),
|
255
|
+
height: $module.outerHeight(),
|
256
|
+
},
|
257
|
+
context = {
|
258
|
+
offset: $context.offset(),
|
259
|
+
height: $context.outerHeight(),
|
260
|
+
}
|
261
|
+
;
|
262
|
+
if (!module.is.standardScroll()) {
|
263
|
+
module.debug('Non-standard scroll. Removing scroll offset from element offset');
|
264
|
+
|
265
|
+
scrollContext.top = $scroll.scrollTop();
|
266
|
+
scrollContext.left = $scroll.scrollLeft();
|
267
|
+
|
268
|
+
element.offset.top += scrollContext.top;
|
269
|
+
context.offset.top += scrollContext.top;
|
270
|
+
element.offset.left += scrollContext.left;
|
271
|
+
context.offset.left += scrollContext.left;
|
272
|
+
}
|
273
|
+
module.cache = {
|
274
|
+
fits: (element.height + settings.offset) <= scrollContext.height,
|
275
|
+
sameHeight: element.height === context.height,
|
276
|
+
scrollContext: {
|
277
|
+
height: scrollContext.height,
|
278
|
+
},
|
279
|
+
element: {
|
280
|
+
margin: element.margin,
|
281
|
+
top: element.offset.top - element.margin.top,
|
282
|
+
left: element.offset.left,
|
283
|
+
width: element.width,
|
284
|
+
height: element.height,
|
285
|
+
bottom: element.offset.top + element.height,
|
286
|
+
},
|
287
|
+
context: {
|
288
|
+
top: context.offset.top,
|
289
|
+
height: context.height,
|
290
|
+
bottom: context.offset.top + context.height,
|
291
|
+
},
|
292
|
+
};
|
293
|
+
module.set.containerSize();
|
294
|
+
|
295
|
+
module.stick();
|
296
|
+
module.debug('Caching element positions', module.cache);
|
297
|
+
},
|
298
|
+
},
|
247
299
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
300
|
+
get: {
|
301
|
+
direction: function (scroll) {
|
302
|
+
var
|
303
|
+
direction = 'down'
|
304
|
+
;
|
305
|
+
scroll = scroll || $scroll.scrollTop();
|
306
|
+
if (module.lastScroll && module.lastScroll > scroll) {
|
307
|
+
direction = 'up';
|
308
|
+
}
|
309
|
+
|
310
|
+
return direction;
|
311
|
+
},
|
312
|
+
scrollChange: function (scroll) {
|
313
|
+
scroll = scroll || $scroll.scrollTop();
|
314
|
+
|
315
|
+
return module.lastScroll
|
316
|
+
? scroll - module.lastScroll
|
317
|
+
: 0;
|
318
|
+
},
|
319
|
+
currentElementScroll: function () {
|
320
|
+
if (module.elementScroll) {
|
321
|
+
return module.elementScroll;
|
322
|
+
}
|
323
|
+
|
324
|
+
return module.is.top()
|
325
|
+
? Math.abs(parseInt($module.css('top'), 10)) || 0
|
326
|
+
: Math.abs(parseInt($module.css('bottom'), 10)) || 0;
|
327
|
+
},
|
328
|
+
|
329
|
+
elementScroll: function (scroll) {
|
330
|
+
scroll = scroll || $scroll.scrollTop();
|
331
|
+
var
|
332
|
+
element = module.cache.element,
|
333
|
+
scrollContext = module.cache.scrollContext,
|
334
|
+
delta = module.get.scrollChange(scroll),
|
335
|
+
maxScroll = element.height - scrollContext.height + settings.offset,
|
336
|
+
elementScroll = module.get.currentElementScroll(),
|
337
|
+
possibleScroll = elementScroll + delta
|
338
|
+
;
|
339
|
+
if (module.cache.fits || possibleScroll < 0) {
|
340
|
+
elementScroll = 0;
|
341
|
+
} else if (possibleScroll > maxScroll) {
|
342
|
+
elementScroll = maxScroll;
|
343
|
+
} else {
|
344
|
+
elementScroll = possibleScroll;
|
345
|
+
}
|
346
|
+
|
347
|
+
return elementScroll;
|
348
|
+
},
|
349
|
+
},
|
276
350
|
|
277
|
-
|
278
|
-
|
351
|
+
remove: {
|
352
|
+
lastScroll: function () {
|
353
|
+
delete module.lastScroll;
|
354
|
+
},
|
355
|
+
elementScroll: function () {
|
356
|
+
delete module.elementScroll;
|
357
|
+
},
|
358
|
+
minimumSize: function () {
|
359
|
+
$container
|
360
|
+
.css('min-height', '')
|
361
|
+
;
|
362
|
+
},
|
363
|
+
offset: function () {
|
364
|
+
$module.css('margin-top', '');
|
365
|
+
},
|
366
|
+
},
|
279
367
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
368
|
+
set: {
|
369
|
+
offset: function () {
|
370
|
+
module.verbose('Setting offset on element', settings.offset);
|
371
|
+
$module
|
372
|
+
.css('margin-top', settings.offset)
|
373
|
+
;
|
374
|
+
},
|
375
|
+
containerSize: function () {
|
376
|
+
var
|
377
|
+
tagName = $container[0].tagName
|
378
|
+
;
|
379
|
+
if (tagName === 'HTML' || tagName === 'body') {
|
380
|
+
module.determineContainer();
|
381
|
+
} else {
|
382
|
+
var tallestHeight = Math.max(module.cache.context.height, module.cache.element.height);
|
383
|
+
if (tallestHeight - $container.outerHeight() > settings.jitter) {
|
384
|
+
module.debug('Context is taller than container. Specifying exact height for container', module.cache.context.height);
|
385
|
+
$container.css({
|
386
|
+
height: tallestHeight,
|
387
|
+
});
|
388
|
+
} else {
|
389
|
+
$container.css({
|
390
|
+
height: '',
|
391
|
+
});
|
392
|
+
}
|
393
|
+
if (Math.abs($container.outerHeight() - module.cache.context.height) > settings.jitter) {
|
394
|
+
module.debug('Context has padding, specifying exact height for container', module.cache.context.height);
|
395
|
+
$container.css({
|
396
|
+
height: module.cache.context.height,
|
397
|
+
});
|
398
|
+
}
|
399
|
+
}
|
400
|
+
},
|
401
|
+
minimumSize: function () {
|
402
|
+
var
|
403
|
+
element = module.cache.element
|
404
|
+
;
|
405
|
+
$container
|
406
|
+
.css('min-height', element.height)
|
407
|
+
;
|
408
|
+
},
|
409
|
+
scroll: function (scroll) {
|
410
|
+
module.debug('Setting scroll on element', scroll);
|
411
|
+
if (module.elementScroll === scroll) {
|
412
|
+
return;
|
413
|
+
}
|
414
|
+
if (module.is.top()) {
|
415
|
+
$module
|
416
|
+
.css('bottom', '')
|
417
|
+
.css('top', -scroll + 'px')
|
418
|
+
;
|
419
|
+
}
|
420
|
+
if (module.is.bottom()) {
|
421
|
+
$module
|
422
|
+
.css('top', '')
|
423
|
+
.css('bottom', scroll + 'px')
|
424
|
+
;
|
425
|
+
}
|
426
|
+
},
|
427
|
+
size: function () {
|
428
|
+
if (module.cache.element.height !== 0 && module.cache.element.width !== 0) {
|
429
|
+
element.style.setProperty('width', module.cache.element.width + 'px', 'important');
|
430
|
+
element.style.setProperty('height', module.cache.element.height + 'px', 'important');
|
431
|
+
}
|
432
|
+
},
|
433
|
+
},
|
306
434
|
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
435
|
+
is: {
|
436
|
+
standardScroll: function () {
|
437
|
+
return $scroll[0] === window;
|
438
|
+
},
|
439
|
+
top: function () {
|
440
|
+
return $module.hasClass(className.top);
|
441
|
+
},
|
442
|
+
bottom: function () {
|
443
|
+
return $module.hasClass(className.bottom);
|
444
|
+
},
|
445
|
+
initialPosition: function () {
|
446
|
+
return !module.is.fixed() && !module.is.bound();
|
447
|
+
},
|
448
|
+
hidden: function () {
|
449
|
+
return !$module.is(':visible');
|
450
|
+
},
|
451
|
+
bound: function () {
|
452
|
+
return $module.hasClass(className.bound);
|
453
|
+
},
|
454
|
+
fixed: function () {
|
455
|
+
return $module.hasClass(className.fixed);
|
456
|
+
},
|
457
|
+
},
|
311
458
|
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
459
|
+
stick: function (scrollPosition) {
|
460
|
+
var
|
461
|
+
cachedPosition = scrollPosition || $scroll.scrollTop(),
|
462
|
+
cache = module.cache,
|
463
|
+
fits = cache.fits,
|
464
|
+
sameHeight = cache.sameHeight,
|
465
|
+
element = cache.element,
|
466
|
+
scrollContext = cache.scrollContext,
|
467
|
+
context = cache.context,
|
468
|
+
offset = module.is.bottom() && settings.pushing
|
469
|
+
? settings.bottomOffset
|
470
|
+
: settings.offset,
|
471
|
+
scroll = {
|
472
|
+
top: cachedPosition + offset,
|
473
|
+
bottom: cachedPosition + offset + scrollContext.height,
|
474
|
+
},
|
475
|
+
elementScroll = fits
|
476
|
+
? 0
|
477
|
+
: module.get.elementScroll(scroll.top),
|
478
|
+
|
479
|
+
// shorthand
|
480
|
+
doesntFit = !fits,
|
481
|
+
elementVisible = element.height !== 0
|
482
|
+
;
|
483
|
+
if (elementVisible && !sameHeight) {
|
484
|
+
if (module.is.initialPosition()) {
|
485
|
+
if (scroll.top >= context.bottom) {
|
486
|
+
module.debug('Initial element position is bottom of container');
|
487
|
+
module.bindBottom();
|
488
|
+
} else if (scroll.top > element.top) {
|
489
|
+
if ((element.height + scroll.top - elementScroll) >= context.bottom && element.height < context.height) {
|
490
|
+
module.debug('Initial element position is bottom of container');
|
491
|
+
module.bindBottom();
|
492
|
+
} else {
|
493
|
+
module.debug('Initial element position is fixed');
|
494
|
+
module.fixTop();
|
495
|
+
}
|
496
|
+
}
|
497
|
+
} else if (module.is.fixed()) {
|
498
|
+
if (module.is.top()) {
|
499
|
+
if (scroll.top <= element.top) {
|
500
|
+
module.debug('Fixed element reached top of container');
|
501
|
+
module.setInitialPosition();
|
502
|
+
} else if ((element.height + scroll.top - elementScroll) >= context.bottom) {
|
503
|
+
module.debug('Fixed element reached bottom of container');
|
504
|
+
module.bindBottom();
|
505
|
+
} else if (doesntFit) { // scroll element if larger than screen
|
506
|
+
module.set.scroll(elementScroll);
|
507
|
+
module.save.lastScroll(scroll.top);
|
508
|
+
module.save.elementScroll(elementScroll);
|
509
|
+
}
|
510
|
+
} else if (module.is.bottom()) {
|
511
|
+
if ((scroll.bottom - element.height) <= element.top) { // top edge
|
512
|
+
module.debug('Bottom fixed rail has reached top of container');
|
513
|
+
module.setInitialPosition();
|
514
|
+
} else if (scroll.bottom >= context.bottom) { // bottom edge
|
515
|
+
module.debug('Bottom fixed rail has reached bottom of container');
|
516
|
+
module.bindBottom();
|
517
|
+
} else if (doesntFit) { // scroll element if larger than screen
|
518
|
+
module.set.scroll(elementScroll);
|
519
|
+
module.save.lastScroll(scroll.top);
|
520
|
+
module.save.elementScroll(elementScroll);
|
521
|
+
}
|
522
|
+
}
|
523
|
+
} else if (module.is.bottom()) {
|
524
|
+
if (scroll.top <= element.top) {
|
525
|
+
module.debug('Jumped from bottom fixed to top fixed, most likely used home/end button');
|
526
|
+
module.setInitialPosition();
|
527
|
+
} else {
|
528
|
+
if (settings.pushing) {
|
529
|
+
if (module.is.bound() && scroll.bottom <= context.bottom) {
|
530
|
+
module.debug('Fixing bottom attached element to bottom of browser.');
|
531
|
+
module.fixBottom();
|
532
|
+
}
|
533
|
+
} else {
|
534
|
+
if (module.is.bound() && (scroll.top <= context.bottom - element.height)) {
|
535
|
+
module.debug('Fixing bottom attached element to top of browser.');
|
536
|
+
module.fixTop();
|
537
|
+
}
|
538
|
+
}
|
539
|
+
}
|
540
|
+
}
|
541
|
+
}
|
542
|
+
},
|
339
543
|
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
544
|
+
bindTop: function () {
|
545
|
+
module.debug('Binding element to top of parent container');
|
546
|
+
module.remove.offset();
|
547
|
+
if (settings.setSize) {
|
548
|
+
module.set.size();
|
549
|
+
}
|
550
|
+
$module
|
551
|
+
.css({
|
552
|
+
left: '',
|
553
|
+
top: '',
|
554
|
+
marginBottom: '',
|
555
|
+
})
|
556
|
+
.removeClass(className.fixed)
|
557
|
+
.removeClass(className.bottom)
|
558
|
+
.addClass(className.bound)
|
559
|
+
.addClass(className.top)
|
560
|
+
;
|
561
|
+
settings.onTop.call(element);
|
562
|
+
settings.onUnstick.call(element);
|
563
|
+
},
|
564
|
+
bindBottom: function () {
|
565
|
+
module.debug('Binding element to bottom of parent container');
|
566
|
+
module.remove.offset();
|
567
|
+
if (settings.setSize) {
|
568
|
+
module.set.size();
|
569
|
+
}
|
570
|
+
$module
|
571
|
+
.css({
|
572
|
+
left: '',
|
573
|
+
top: '',
|
574
|
+
})
|
575
|
+
.removeClass(className.fixed)
|
576
|
+
.removeClass(className.top)
|
577
|
+
.addClass(className.bound)
|
578
|
+
.addClass(className.bottom)
|
579
|
+
;
|
580
|
+
settings.onBottom.call(element);
|
581
|
+
settings.onUnstick.call(element);
|
582
|
+
},
|
362
583
|
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
delete module.elementScroll;
|
369
|
-
},
|
370
|
-
minimumSize: function() {
|
371
|
-
$container
|
372
|
-
.css('min-height', '')
|
373
|
-
;
|
374
|
-
},
|
375
|
-
offset: function() {
|
376
|
-
$module.css('margin-top', '');
|
377
|
-
}
|
378
|
-
},
|
584
|
+
setInitialPosition: function () {
|
585
|
+
module.debug('Returning to initial position');
|
586
|
+
module.unfix();
|
587
|
+
module.unbind();
|
588
|
+
},
|
379
589
|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
$container.css({
|
401
|
-
height: tallestHeight,
|
402
|
-
});
|
403
|
-
}
|
404
|
-
else {
|
405
|
-
$container.css({
|
406
|
-
height: '',
|
407
|
-
});
|
408
|
-
}
|
409
|
-
if( Math.abs($container.outerHeight() - module.cache.context.height) > settings.jitter) {
|
410
|
-
module.debug('Context has padding, specifying exact height for container', module.cache.context.height);
|
411
|
-
$container.css({
|
412
|
-
height: module.cache.context.height
|
413
|
-
});
|
414
|
-
}
|
415
|
-
}
|
416
|
-
},
|
417
|
-
minimumSize: function() {
|
418
|
-
var
|
419
|
-
element = module.cache.element
|
420
|
-
;
|
421
|
-
$container
|
422
|
-
.css('min-height', element.height)
|
423
|
-
;
|
424
|
-
},
|
425
|
-
scroll: function(scroll) {
|
426
|
-
module.debug('Setting scroll on element', scroll);
|
427
|
-
if(module.elementScroll == scroll) {
|
428
|
-
return;
|
429
|
-
}
|
430
|
-
if( module.is.top() ) {
|
431
|
-
$module
|
432
|
-
.css('bottom', '')
|
433
|
-
.css('top', -scroll)
|
434
|
-
;
|
435
|
-
}
|
436
|
-
if( module.is.bottom() ) {
|
437
|
-
$module
|
438
|
-
.css('top', '')
|
439
|
-
.css('bottom', scroll)
|
440
|
-
;
|
441
|
-
}
|
442
|
-
},
|
443
|
-
size: function() {
|
444
|
-
if(module.cache.element.height !== 0 && module.cache.element.width !== 0) {
|
445
|
-
element.style.setProperty('width', module.cache.element.width + 'px', 'important');
|
446
|
-
element.style.setProperty('height', module.cache.element.height + 'px', 'important');
|
447
|
-
}
|
448
|
-
}
|
449
|
-
},
|
590
|
+
fixTop: function () {
|
591
|
+
module.debug('Fixing element to top of page');
|
592
|
+
if (settings.setSize) {
|
593
|
+
module.set.size();
|
594
|
+
}
|
595
|
+
module.set.minimumSize();
|
596
|
+
module.set.offset();
|
597
|
+
$module
|
598
|
+
.css({
|
599
|
+
left: module.cache.element.left,
|
600
|
+
bottom: '',
|
601
|
+
marginBottom: '',
|
602
|
+
})
|
603
|
+
.removeClass(className.bound)
|
604
|
+
.removeClass(className.bottom)
|
605
|
+
.addClass(className.fixed)
|
606
|
+
.addClass(className.top)
|
607
|
+
;
|
608
|
+
settings.onStick.call(element);
|
609
|
+
},
|
450
610
|
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
return $module.hasClass(className.fixed);
|
472
|
-
}
|
473
|
-
},
|
611
|
+
fixBottom: function () {
|
612
|
+
module.debug('Sticking element to bottom of page');
|
613
|
+
if (settings.setSize) {
|
614
|
+
module.set.size();
|
615
|
+
}
|
616
|
+
module.set.minimumSize();
|
617
|
+
module.set.offset();
|
618
|
+
$module
|
619
|
+
.css({
|
620
|
+
left: module.cache.element.left,
|
621
|
+
bottom: '',
|
622
|
+
marginBottom: '',
|
623
|
+
})
|
624
|
+
.removeClass(className.bound)
|
625
|
+
.removeClass(className.top)
|
626
|
+
.addClass(className.fixed)
|
627
|
+
.addClass(className.bottom)
|
628
|
+
;
|
629
|
+
settings.onStick.call(element);
|
630
|
+
},
|
474
631
|
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
: settings.offset,
|
487
|
-
scroll = {
|
488
|
-
top : cachedPosition + offset,
|
489
|
-
bottom : cachedPosition + offset + scrollContext.height
|
490
|
-
},
|
491
|
-
elementScroll = (fits)
|
492
|
-
? 0
|
493
|
-
: module.get.elementScroll(scroll.top),
|
494
|
-
|
495
|
-
// shorthand
|
496
|
-
doesntFit = !fits,
|
497
|
-
elementVisible = (element.height !== 0)
|
498
|
-
;
|
499
|
-
if(elementVisible && !sameHeight) {
|
500
|
-
|
501
|
-
if( module.is.initialPosition() ) {
|
502
|
-
if(scroll.top >= context.bottom) {
|
503
|
-
module.debug('Initial element position is bottom of container');
|
504
|
-
module.bindBottom();
|
505
|
-
}
|
506
|
-
else if(scroll.top > element.top) {
|
507
|
-
if( (element.height + scroll.top - elementScroll) >= context.bottom && element.height < context.height) {
|
508
|
-
module.debug('Initial element position is bottom of container');
|
509
|
-
module.bindBottom();
|
510
|
-
}
|
511
|
-
else {
|
512
|
-
module.debug('Initial element position is fixed');
|
513
|
-
module.fixTop();
|
514
|
-
}
|
515
|
-
}
|
632
|
+
unbind: function () {
|
633
|
+
if (module.is.bound()) {
|
634
|
+
module.debug('Removing container bound position on element');
|
635
|
+
module.remove.offset();
|
636
|
+
$module
|
637
|
+
.removeClass(className.bound)
|
638
|
+
.removeClass(className.top)
|
639
|
+
.removeClass(className.bottom)
|
640
|
+
;
|
641
|
+
}
|
642
|
+
},
|
516
643
|
|
517
|
-
|
518
|
-
|
644
|
+
unfix: function () {
|
645
|
+
if (module.is.fixed()) {
|
646
|
+
module.debug('Removing fixed position on element');
|
647
|
+
module.remove.minimumSize();
|
648
|
+
module.remove.offset();
|
649
|
+
$module
|
650
|
+
.removeClass(className.fixed)
|
651
|
+
.removeClass(className.top)
|
652
|
+
.removeClass(className.bottom)
|
653
|
+
;
|
654
|
+
settings.onUnstick.call(element);
|
655
|
+
}
|
656
|
+
},
|
519
657
|
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
module.bindBottom();
|
529
|
-
}
|
530
|
-
// scroll element if larger than screen
|
531
|
-
else if(doesntFit) {
|
532
|
-
module.set.scroll(elementScroll);
|
533
|
-
module.save.lastScroll(scroll.top);
|
534
|
-
module.save.elementScroll(elementScroll);
|
535
|
-
}
|
536
|
-
}
|
658
|
+
reset: function () {
|
659
|
+
module.debug('Resetting elements position');
|
660
|
+
module.unbind();
|
661
|
+
module.unfix();
|
662
|
+
module.resetCSS();
|
663
|
+
module.remove.offset();
|
664
|
+
module.remove.lastScroll();
|
665
|
+
},
|
537
666
|
|
538
|
-
|
539
|
-
|
667
|
+
resetCSS: function () {
|
668
|
+
$module
|
669
|
+
.css({
|
670
|
+
width: '',
|
671
|
+
height: '',
|
672
|
+
})
|
673
|
+
;
|
674
|
+
$container
|
675
|
+
.css({
|
676
|
+
height: '',
|
677
|
+
})
|
678
|
+
;
|
679
|
+
},
|
540
680
|
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
681
|
+
setting: function (name, value) {
|
682
|
+
if ($.isPlainObject(name)) {
|
683
|
+
$.extend(true, settings, name);
|
684
|
+
} else if (value !== undefined) {
|
685
|
+
settings[name] = value;
|
686
|
+
} else {
|
687
|
+
return settings[name];
|
688
|
+
}
|
689
|
+
},
|
690
|
+
internal: function (name, value) {
|
691
|
+
if ($.isPlainObject(name)) {
|
692
|
+
$.extend(true, module, name);
|
693
|
+
} else if (value !== undefined) {
|
694
|
+
module[name] = value;
|
695
|
+
} else {
|
696
|
+
return module[name];
|
697
|
+
}
|
698
|
+
},
|
699
|
+
debug: function () {
|
700
|
+
if (!settings.silent && settings.debug) {
|
701
|
+
if (settings.performance) {
|
702
|
+
module.performance.log(arguments);
|
703
|
+
} else {
|
704
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
705
|
+
module.debug.apply(console, arguments);
|
706
|
+
}
|
707
|
+
}
|
708
|
+
},
|
709
|
+
verbose: function () {
|
710
|
+
if (!settings.silent && settings.verbose && settings.debug) {
|
711
|
+
if (settings.performance) {
|
712
|
+
module.performance.log(arguments);
|
713
|
+
} else {
|
714
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
715
|
+
module.verbose.apply(console, arguments);
|
716
|
+
}
|
717
|
+
}
|
718
|
+
},
|
719
|
+
error: function () {
|
720
|
+
if (!settings.silent) {
|
721
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
722
|
+
module.error.apply(console, arguments);
|
723
|
+
}
|
724
|
+
},
|
725
|
+
performance: {
|
726
|
+
log: function (message) {
|
727
|
+
var
|
728
|
+
currentTime,
|
729
|
+
executionTime,
|
730
|
+
previousTime
|
731
|
+
;
|
732
|
+
if (settings.performance) {
|
733
|
+
currentTime = Date.now();
|
734
|
+
previousTime = time || currentTime;
|
735
|
+
executionTime = currentTime - previousTime;
|
736
|
+
time = currentTime;
|
737
|
+
performance.push({
|
738
|
+
Name: message[0],
|
739
|
+
Arguments: [].slice.call(message, 1) || '',
|
740
|
+
Element: element,
|
741
|
+
'Execution Time': executionTime,
|
742
|
+
});
|
743
|
+
}
|
744
|
+
clearTimeout(module.performance.timer);
|
745
|
+
module.performance.timer = setTimeout(module.performance.display, 0);
|
746
|
+
},
|
747
|
+
display: function () {
|
748
|
+
var
|
749
|
+
title = settings.name + ':',
|
750
|
+
totalTime = 0
|
751
|
+
;
|
752
|
+
time = false;
|
753
|
+
clearTimeout(module.performance.timer);
|
754
|
+
$.each(performance, function (index, data) {
|
755
|
+
totalTime += data['Execution Time'];
|
756
|
+
});
|
757
|
+
title += ' ' + totalTime + 'ms';
|
758
|
+
if (moduleSelector) {
|
759
|
+
title += ' \'' + moduleSelector + '\'';
|
760
|
+
}
|
761
|
+
if (performance.length > 0) {
|
762
|
+
console.groupCollapsed(title);
|
763
|
+
if (console.table) {
|
764
|
+
console.table(performance);
|
765
|
+
} else {
|
766
|
+
$.each(performance, function (index, data) {
|
767
|
+
console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
|
768
|
+
});
|
769
|
+
}
|
770
|
+
console.groupEnd();
|
771
|
+
}
|
772
|
+
performance = [];
|
773
|
+
},
|
774
|
+
},
|
775
|
+
invoke: function (query, passedArguments, context) {
|
776
|
+
var
|
777
|
+
object = instance,
|
778
|
+
maxDepth,
|
779
|
+
found,
|
780
|
+
response
|
781
|
+
;
|
782
|
+
passedArguments = passedArguments || queryArguments;
|
783
|
+
context = context || element;
|
784
|
+
if (typeof query === 'string' && object !== undefined) {
|
785
|
+
query = query.split(/[ .]/);
|
786
|
+
maxDepth = query.length - 1;
|
787
|
+
$.each(query, function (depth, value) {
|
788
|
+
var camelCaseValue = depth !== maxDepth
|
789
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
790
|
+
: query
|
791
|
+
;
|
792
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
793
|
+
object = object[camelCaseValue];
|
794
|
+
} else if (object[camelCaseValue] !== undefined) {
|
795
|
+
found = object[camelCaseValue];
|
796
|
+
|
797
|
+
return false;
|
798
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
799
|
+
object = object[value];
|
800
|
+
} else if (object[value] !== undefined) {
|
801
|
+
found = object[value];
|
802
|
+
|
803
|
+
return false;
|
804
|
+
} else {
|
805
|
+
module.error(error.method, query);
|
806
|
+
|
807
|
+
return false;
|
808
|
+
}
|
809
|
+
});
|
810
|
+
}
|
811
|
+
if (isFunction(found)) {
|
812
|
+
response = found.apply(context, passedArguments);
|
813
|
+
} else if (found !== undefined) {
|
814
|
+
response = found;
|
815
|
+
}
|
816
|
+
if (Array.isArray(returnedValue)) {
|
817
|
+
returnedValue.push(response);
|
818
|
+
} else if (returnedValue !== undefined) {
|
819
|
+
returnedValue = [returnedValue, response];
|
820
|
+
} else if (response !== undefined) {
|
821
|
+
returnedValue = response;
|
822
|
+
}
|
823
|
+
|
824
|
+
return found;
|
825
|
+
},
|
826
|
+
};
|
557
827
|
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
if( scroll.top <= element.top ) {
|
562
|
-
module.debug('Jumped from bottom fixed to top fixed, most likely used home/end button');
|
563
|
-
module.setInitialPosition();
|
564
|
-
}
|
565
|
-
else {
|
566
|
-
if(settings.pushing) {
|
567
|
-
if(module.is.bound() && scroll.bottom <= context.bottom ) {
|
568
|
-
module.debug('Fixing bottom attached element to bottom of browser.');
|
569
|
-
module.fixBottom();
|
570
|
-
}
|
828
|
+
if (methodInvoked) {
|
829
|
+
if (instance === undefined) {
|
830
|
+
module.initialize();
|
571
831
|
}
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
}
|
832
|
+
module.invoke(query);
|
833
|
+
} else {
|
834
|
+
if (instance !== undefined) {
|
835
|
+
instance.invoke('destroy');
|
577
836
|
}
|
578
|
-
|
837
|
+
module.initialize();
|
579
838
|
}
|
580
|
-
|
581
|
-
},
|
839
|
+
});
|
582
840
|
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
module.set.size();
|
588
|
-
}
|
589
|
-
$module
|
590
|
-
.css({
|
591
|
-
left : '',
|
592
|
-
top : '',
|
593
|
-
marginBottom : ''
|
594
|
-
})
|
595
|
-
.removeClass(className.fixed)
|
596
|
-
.removeClass(className.bottom)
|
597
|
-
.addClass(className.bound)
|
598
|
-
.addClass(className.top)
|
599
|
-
;
|
600
|
-
settings.onTop.call(element);
|
601
|
-
settings.onUnstick.call(element);
|
602
|
-
},
|
603
|
-
bindBottom: function() {
|
604
|
-
module.debug('Binding element to bottom of parent container');
|
605
|
-
module.remove.offset();
|
606
|
-
if(settings.setSize) {
|
607
|
-
module.set.size();
|
608
|
-
}
|
609
|
-
$module
|
610
|
-
.css({
|
611
|
-
left : '',
|
612
|
-
top : ''
|
613
|
-
})
|
614
|
-
.removeClass(className.fixed)
|
615
|
-
.removeClass(className.top)
|
616
|
-
.addClass(className.bound)
|
617
|
-
.addClass(className.bottom)
|
618
|
-
;
|
619
|
-
settings.onBottom.call(element);
|
620
|
-
settings.onUnstick.call(element);
|
621
|
-
},
|
841
|
+
return returnedValue !== undefined
|
842
|
+
? returnedValue
|
843
|
+
: this;
|
844
|
+
};
|
622
845
|
|
623
|
-
|
624
|
-
module.debug('Returning to initial position');
|
625
|
-
module.unfix();
|
626
|
-
module.unbind();
|
627
|
-
},
|
846
|
+
$.fn.sticky.settings = {
|
628
847
|
|
848
|
+
name: 'Sticky',
|
849
|
+
namespace: 'sticky',
|
629
850
|
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
}
|
635
|
-
module.set.minimumSize();
|
636
|
-
module.set.offset();
|
637
|
-
$module
|
638
|
-
.css({
|
639
|
-
left : module.cache.element.left,
|
640
|
-
bottom : '',
|
641
|
-
marginBottom : ''
|
642
|
-
})
|
643
|
-
.removeClass(className.bound)
|
644
|
-
.removeClass(className.bottom)
|
645
|
-
.addClass(className.fixed)
|
646
|
-
.addClass(className.top)
|
647
|
-
;
|
648
|
-
settings.onStick.call(element);
|
649
|
-
},
|
851
|
+
silent: false,
|
852
|
+
debug: false,
|
853
|
+
verbose: true,
|
854
|
+
performance: true,
|
650
855
|
|
651
|
-
|
652
|
-
|
653
|
-
if(settings.setSize) {
|
654
|
-
module.set.size();
|
655
|
-
}
|
656
|
-
module.set.minimumSize();
|
657
|
-
module.set.offset();
|
658
|
-
$module
|
659
|
-
.css({
|
660
|
-
left : module.cache.element.left,
|
661
|
-
bottom : '',
|
662
|
-
marginBottom : ''
|
663
|
-
})
|
664
|
-
.removeClass(className.bound)
|
665
|
-
.removeClass(className.top)
|
666
|
-
.addClass(className.fixed)
|
667
|
-
.addClass(className.bottom)
|
668
|
-
;
|
669
|
-
settings.onStick.call(element);
|
670
|
-
},
|
856
|
+
// whether to stick in the opposite direction on scroll up
|
857
|
+
pushing: false,
|
671
858
|
|
672
|
-
|
673
|
-
|
674
|
-
module.debug('Removing container bound position on element');
|
675
|
-
module.remove.offset();
|
676
|
-
$module
|
677
|
-
.removeClass(className.bound)
|
678
|
-
.removeClass(className.top)
|
679
|
-
.removeClass(className.bottom)
|
680
|
-
;
|
681
|
-
}
|
682
|
-
},
|
859
|
+
context: false,
|
860
|
+
container: false,
|
683
861
|
|
684
|
-
|
685
|
-
|
686
|
-
module.debug('Removing fixed position on element');
|
687
|
-
module.remove.minimumSize();
|
688
|
-
module.remove.offset();
|
689
|
-
$module
|
690
|
-
.removeClass(className.fixed)
|
691
|
-
.removeClass(className.top)
|
692
|
-
.removeClass(className.bottom)
|
693
|
-
;
|
694
|
-
settings.onUnstick.call(element);
|
695
|
-
}
|
696
|
-
},
|
862
|
+
// Context to watch scroll events
|
863
|
+
scrollContext: window,
|
697
864
|
|
698
|
-
|
699
|
-
|
700
|
-
module.unbind();
|
701
|
-
module.unfix();
|
702
|
-
module.resetCSS();
|
703
|
-
module.remove.offset();
|
704
|
-
module.remove.lastScroll();
|
705
|
-
},
|
865
|
+
// Offset to adjust scroll
|
866
|
+
offset: 0,
|
706
867
|
|
707
|
-
|
708
|
-
|
709
|
-
.css({
|
710
|
-
width : '',
|
711
|
-
height : ''
|
712
|
-
})
|
713
|
-
;
|
714
|
-
$container
|
715
|
-
.css({
|
716
|
-
height: ''
|
717
|
-
})
|
718
|
-
;
|
719
|
-
},
|
868
|
+
// Offset to adjust scroll when attached to bottom of screen
|
869
|
+
bottomOffset: 0,
|
720
870
|
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
},
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
},
|
754
|
-
verbose: function() {
|
755
|
-
if(!settings.silent && settings.verbose && settings.debug) {
|
756
|
-
if(settings.performance) {
|
757
|
-
module.performance.log(arguments);
|
758
|
-
}
|
759
|
-
else {
|
760
|
-
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
761
|
-
module.verbose.apply(console, arguments);
|
762
|
-
}
|
763
|
-
}
|
764
|
-
},
|
765
|
-
error: function() {
|
766
|
-
if(!settings.silent) {
|
767
|
-
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
768
|
-
module.error.apply(console, arguments);
|
769
|
-
}
|
871
|
+
// will only set container height if difference between context and container is larger than this number
|
872
|
+
jitter: 5,
|
873
|
+
|
874
|
+
// set width of sticky element when it is fixed to page (used to make sure 100% width is maintained if no fixed size set)
|
875
|
+
setSize: true,
|
876
|
+
|
877
|
+
// Whether to automatically observe changes with Mutation Observers
|
878
|
+
observeChanges: false,
|
879
|
+
|
880
|
+
// Called when position is recalculated
|
881
|
+
onReposition: function () {},
|
882
|
+
|
883
|
+
// Called on each scroll
|
884
|
+
onScroll: function () {},
|
885
|
+
|
886
|
+
// Called when element is stuck to viewport
|
887
|
+
onStick: function () {},
|
888
|
+
|
889
|
+
// Called when element is unstuck from viewport
|
890
|
+
onUnstick: function () {},
|
891
|
+
|
892
|
+
// Called when element reaches top of context
|
893
|
+
onTop: function () {},
|
894
|
+
|
895
|
+
// Called when element reaches bottom of context
|
896
|
+
onBottom: function () {},
|
897
|
+
|
898
|
+
error: {
|
899
|
+
visible: 'Element is hidden, you must call refresh after element becomes visible. Use silent setting to suppress this warning in production.',
|
900
|
+
method: 'The method you called is not defined.',
|
901
|
+
invalidContext: 'Context specified does not exist',
|
902
|
+
elementSize: 'Sticky element is larger than its container, cannot create sticky.',
|
770
903
|
},
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
if(settings.performance) {
|
779
|
-
currentTime = new Date().getTime();
|
780
|
-
previousTime = time || currentTime;
|
781
|
-
executionTime = currentTime - previousTime;
|
782
|
-
time = currentTime;
|
783
|
-
performance.push({
|
784
|
-
'Name' : message[0],
|
785
|
-
'Arguments' : [].slice.call(message, 1) || '',
|
786
|
-
'Element' : element,
|
787
|
-
'Execution Time' : executionTime
|
788
|
-
});
|
789
|
-
}
|
790
|
-
clearTimeout(module.performance.timer);
|
791
|
-
module.performance.timer = setTimeout(module.performance.display, 0);
|
792
|
-
},
|
793
|
-
display: function() {
|
794
|
-
var
|
795
|
-
title = settings.name + ':',
|
796
|
-
totalTime = 0
|
797
|
-
;
|
798
|
-
time = false;
|
799
|
-
clearTimeout(module.performance.timer);
|
800
|
-
$.each(performance, function(index, data) {
|
801
|
-
totalTime += data['Execution Time'];
|
802
|
-
});
|
803
|
-
title += ' ' + totalTime + 'ms';
|
804
|
-
if(moduleSelector) {
|
805
|
-
title += ' \'' + moduleSelector + '\'';
|
806
|
-
}
|
807
|
-
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
808
|
-
console.groupCollapsed(title);
|
809
|
-
if(console.table) {
|
810
|
-
console.table(performance);
|
811
|
-
}
|
812
|
-
else {
|
813
|
-
$.each(performance, function(index, data) {
|
814
|
-
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
815
|
-
});
|
816
|
-
}
|
817
|
-
console.groupEnd();
|
818
|
-
}
|
819
|
-
performance = [];
|
820
|
-
}
|
904
|
+
|
905
|
+
className: {
|
906
|
+
bound: 'bound',
|
907
|
+
fixed: 'fixed',
|
908
|
+
supported: 'native',
|
909
|
+
top: 'top',
|
910
|
+
bottom: 'bottom',
|
821
911
|
},
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
maxDepth,
|
826
|
-
found,
|
827
|
-
response
|
828
|
-
;
|
829
|
-
passedArguments = passedArguments || queryArguments;
|
830
|
-
context = context || element;
|
831
|
-
if(typeof query == 'string' && object !== undefined) {
|
832
|
-
query = query.split(/[\. ]/);
|
833
|
-
maxDepth = query.length - 1;
|
834
|
-
$.each(query, function(depth, value) {
|
835
|
-
var camelCaseValue = (depth != maxDepth)
|
836
|
-
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
837
|
-
: query
|
838
|
-
;
|
839
|
-
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
840
|
-
object = object[camelCaseValue];
|
841
|
-
}
|
842
|
-
else if( object[camelCaseValue] !== undefined ) {
|
843
|
-
found = object[camelCaseValue];
|
844
|
-
return false;
|
845
|
-
}
|
846
|
-
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
847
|
-
object = object[value];
|
848
|
-
}
|
849
|
-
else if( object[value] !== undefined ) {
|
850
|
-
found = object[value];
|
851
|
-
return false;
|
852
|
-
}
|
853
|
-
else {
|
854
|
-
return false;
|
855
|
-
}
|
856
|
-
});
|
857
|
-
}
|
858
|
-
if ( $.isFunction( found ) ) {
|
859
|
-
response = found.apply(context, passedArguments);
|
860
|
-
}
|
861
|
-
else if(found !== undefined) {
|
862
|
-
response = found;
|
863
|
-
}
|
864
|
-
if(Array.isArray(returnedValue)) {
|
865
|
-
returnedValue.push(response);
|
866
|
-
}
|
867
|
-
else if(returnedValue !== undefined) {
|
868
|
-
returnedValue = [returnedValue, response];
|
869
|
-
}
|
870
|
-
else if(response !== undefined) {
|
871
|
-
returnedValue = response;
|
872
|
-
}
|
873
|
-
return found;
|
874
|
-
}
|
875
|
-
};
|
876
|
-
|
877
|
-
if(methodInvoked) {
|
878
|
-
if(instance === undefined) {
|
879
|
-
module.initialize();
|
880
|
-
}
|
881
|
-
module.invoke(query);
|
882
|
-
}
|
883
|
-
else {
|
884
|
-
if(instance !== undefined) {
|
885
|
-
instance.invoke('destroy');
|
886
|
-
}
|
887
|
-
module.initialize();
|
888
|
-
}
|
889
|
-
})
|
890
|
-
;
|
891
|
-
|
892
|
-
return (returnedValue !== undefined)
|
893
|
-
? returnedValue
|
894
|
-
: this
|
895
|
-
;
|
896
|
-
};
|
897
|
-
|
898
|
-
$.fn.sticky.settings = {
|
899
|
-
|
900
|
-
name : 'Sticky',
|
901
|
-
namespace : 'sticky',
|
902
|
-
|
903
|
-
silent : false,
|
904
|
-
debug : false,
|
905
|
-
verbose : true,
|
906
|
-
performance : true,
|
907
|
-
|
908
|
-
// whether to stick in the opposite direction on scroll up
|
909
|
-
pushing : false,
|
910
|
-
|
911
|
-
context : false,
|
912
|
-
container : false,
|
913
|
-
|
914
|
-
// Context to watch scroll events
|
915
|
-
scrollContext : window,
|
916
|
-
|
917
|
-
// Offset to adjust scroll
|
918
|
-
offset : 0,
|
919
|
-
|
920
|
-
// Offset to adjust scroll when attached to bottom of screen
|
921
|
-
bottomOffset : 0,
|
922
|
-
|
923
|
-
// will only set container height if difference between context and container is larger than this number
|
924
|
-
jitter : 5,
|
925
|
-
|
926
|
-
// set width of sticky element when it is fixed to page (used to make sure 100% width is maintained if no fixed size set)
|
927
|
-
setSize : true,
|
928
|
-
|
929
|
-
// Whether to automatically observe changes with Mutation Observers
|
930
|
-
observeChanges : false,
|
931
|
-
|
932
|
-
// Called when position is recalculated
|
933
|
-
onReposition : function(){},
|
934
|
-
|
935
|
-
// Called on each scroll
|
936
|
-
onScroll : function(){},
|
937
|
-
|
938
|
-
// Called when element is stuck to viewport
|
939
|
-
onStick : function(){},
|
940
|
-
|
941
|
-
// Called when element is unstuck from viewport
|
942
|
-
onUnstick : function(){},
|
943
|
-
|
944
|
-
// Called when element reaches top of context
|
945
|
-
onTop : function(){},
|
946
|
-
|
947
|
-
// Called when element reaches bottom of context
|
948
|
-
onBottom : function(){},
|
949
|
-
|
950
|
-
error : {
|
951
|
-
container : 'Sticky element must be inside a relative container',
|
952
|
-
visible : 'Element is hidden, you must call refresh after element becomes visible. Use silent setting to suppress this warning in production.',
|
953
|
-
method : 'The method you called is not defined.',
|
954
|
-
invalidContext : 'Context specified does not exist',
|
955
|
-
elementSize : 'Sticky element is larger than its container, cannot create sticky.'
|
956
|
-
},
|
957
|
-
|
958
|
-
className : {
|
959
|
-
bound : 'bound',
|
960
|
-
fixed : 'fixed',
|
961
|
-
supported : 'native',
|
962
|
-
top : 'top',
|
963
|
-
bottom : 'bottom'
|
964
|
-
}
|
965
|
-
|
966
|
-
};
|
967
|
-
|
968
|
-
})( jQuery, window, document );
|
912
|
+
|
913
|
+
};
|
914
|
+
})(jQuery, window, document);
|