Merge newfoundation
commit
0cdfddf061
|
@ -12,6 +12,7 @@
|
|||
{% block extra_css %}{% endblock %}
|
||||
|
||||
<link href="{% sass_src 'scss/global.scss' %}" rel="stylesheet" type="text/css" />
|
||||
<link href="{% sass_src 'scss/foundation/scss/foundation.scss' %}" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="{{ jquery_home }}"></script>
|
||||
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/static/js/sitewide1.js"></script>
|
||||
|
|
|
@ -191,6 +191,9 @@ SASS_PROCESSOR_INCLUDE_DIRS = [
|
|||
os.path.join(PROJECT_DIR),
|
||||
os.path.join(PROJECT_DIR, 'static', 'scss'),
|
||||
os.path.join('static', 'scss'),
|
||||
os.path.join(PROJECT_DIR, 'static', 'scss', 'foundation', 'scss'),
|
||||
os.path.join('static', 'scss', 'foundation', 'scss'),
|
||||
# static/scss/foundation/scss/foundation.scss
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"plugins": [
|
||||
"transform-es2015-arrow-functions",
|
||||
"transform-es2015-block-scoped-functions",
|
||||
"transform-es2015-block-scoping",
|
||||
"transform-es2015-classes",
|
||||
"transform-es2015-destructuring",
|
||||
"transform-es2015-template-literals",
|
||||
"transform-es2015-parameters",
|
||||
"transform-es2015-shorthand-properties",
|
||||
"transform-es2015-spread"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"directory": "bower_components",
|
||||
"modules": false
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
"ecmaVersion": 6,
|
||||
"env": {
|
||||
"browser": true,
|
||||
"builtin": true,
|
||||
"es6": true,
|
||||
"jasmine": true,
|
||||
"jquery": true,
|
||||
"mocha": true,
|
||||
"node": true
|
||||
},
|
||||
"globals": {
|
||||
"Foundation": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"impliedStrict": true,
|
||||
"jsx": false
|
||||
},
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"block-scoped-var": 2,
|
||||
"camelcase": 2,
|
||||
"comma-style": [2, "last"],
|
||||
"curly": [0, "all"],
|
||||
"dot-notation": [
|
||||
2,
|
||||
{
|
||||
"allowKeywords": true
|
||||
}
|
||||
],
|
||||
"eqeqeq": [2, "allow-null"],
|
||||
"guard-for-in": 2,
|
||||
"new-cap": 2,
|
||||
"no-bitwise": 2,
|
||||
"no-caller": 2,
|
||||
"no-cond-assign": [2, "except-parens"],
|
||||
"no-debugger": 2,
|
||||
"no-empty": 2,
|
||||
"no-eval": 2,
|
||||
"no-extend-native": 2,
|
||||
"no-extra-parens": 1,
|
||||
"no-irregular-whitespace": 2,
|
||||
"no-iterator": 2,
|
||||
"no-loop-func": 2,
|
||||
"no-multi-str": 2,
|
||||
"no-new": 2,
|
||||
"no-plusplus": 0,
|
||||
"no-proto": 2,
|
||||
"no-script-url": 2,
|
||||
"no-sequences": 2,
|
||||
"no-shadow": 1,
|
||||
"no-undef": 2,
|
||||
"no-unused-vars": 1,
|
||||
"no-with": 2,
|
||||
"quotes": 0,
|
||||
"radix" : 2,
|
||||
"semi": [0, "never"],
|
||||
"strict": [1, "global"],
|
||||
"valid-typeof": 2,
|
||||
"wrap-iife": [2, "inside"]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<!-- For replicatable bugs or feature requests GitHub is the right place. The [Foundation Forum](http://foundation.zurb.com/forum) would be a great place to seek some help with general questions or help with your code. There you can reach out to the community to share your insights or ask questions. -->
|
||||
|
||||
#### How to reproduce this bug:
|
||||
|
||||
1. Step one
|
||||
2. Step two
|
||||
3. Step three
|
||||
|
||||
#### What should happen:
|
||||
|
||||
#### What happened instead:
|
||||
|
||||
#### Browser(s) and Device(s) tested on:
|
||||
|
||||
#### Foundation Version(s) you are using:
|
||||
|
||||
#### Test case link:
|
||||
|
||||
<!-- Give us a link to a CodePen or JSFiddle that recreates the issue. -->
|
||||
|
||||
- [CodePen with Foundation 6.3.1, Float Grid and MotionUI](http://codepen.io/IamManchanda/pen/LWGZxR)
|
||||
- [CodePen with Foundation 6.3.1, Float Grid with RTL Direction and MotionUI](http://codepen.io/IamManchanda/pen/bRYOMv)
|
||||
- [CodePen with Foundation 6.3.1, Flexbox grid and MotionUI](http://codepen.io/IamManchanda/pen/zZrBEv)
|
||||
|
||||
- [CodePen with Foundation 6.4.1, XY Flexbox grid and MotionUI](http://codepen.io/IamManchanda/pen/EXbGKJ)
|
||||
- [CodePen with Foundation 6.4.1, XY Flexbox grid with RTL Direction and MotionUI](http://codepen.io/IamManchanda/pen/qjVLoO)
|
||||
- [CodePen with Foundation 6.4.1, XY Flexbox grid with Prototype Mode and MotionUI](http://codepen.io/IamManchanda/pen/XgzopG)
|
||||
- [CodePen with Foundation 6.4.1, Float Grid and MotionUI](http://codepen.io/IamManchanda/pen/qjVLrB)
|
|
@ -0,0 +1,9 @@
|
|||
Before submitting a pull request, make sure it's targeting the right branch:
|
||||
|
||||
- For documentation fixes, use `master`.
|
||||
- For bug fixes or new features compatible with the next version, use `develop`.
|
||||
- For bug fixes incompatible with `develop`, use the support branch of the latest compatible version, which will be formatted `support/6.x`.
|
||||
|
||||
If you're fixing a JavaScript issue, it would help to create a new test case under the folder `test/visual/` that recreates the issue and show's that it's been fixed. Run `npm test` to compile the testing folder.
|
||||
|
||||
Happy coding! :)
|
|
@ -0,0 +1,57 @@
|
|||
*.DS_Store
|
||||
*.gem
|
||||
*.orig
|
||||
*.rbc
|
||||
*.rbenv-version
|
||||
*.ruby-version
|
||||
*.scssc
|
||||
*.sublime-*
|
||||
*.swp
|
||||
*.swo
|
||||
.bundle
|
||||
.config
|
||||
.grunt
|
||||
.idea
|
||||
.sass-cache/*
|
||||
.yardoc
|
||||
_build
|
||||
.customizer
|
||||
|
||||
bower_components
|
||||
bundle
|
||||
build/*
|
||||
/docs2/public/*
|
||||
_yardoc
|
||||
coverage
|
||||
docs/public/*
|
||||
InstalledFiles
|
||||
lib/bundler/man
|
||||
marketing/.sass-cache/*
|
||||
node_modules
|
||||
pkg
|
||||
rdoc
|
||||
spec/reports
|
||||
npm-debug.log
|
||||
_debug.json
|
||||
|
||||
*.orig
|
||||
node_modules
|
||||
docs/public/*
|
||||
*.scssc
|
||||
*.rbenv-version
|
||||
*.ruby-version
|
||||
/docs2/public/*
|
||||
.settings
|
||||
.project
|
||||
test/scss/output-test
|
||||
test/tmp
|
||||
test/version_tmp
|
||||
tmp
|
||||
testing/_build
|
||||
test/javascript/js-tests.js
|
||||
|
||||
pizza/
|
||||
data.json
|
||||
npm-debug.log
|
||||
foundation-docs
|
||||
vendor
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"esversion": 6
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
.sass-cache
|
||||
_build
|
||||
bower_components
|
||||
config
|
||||
docs
|
||||
gulp
|
||||
lib
|
||||
spec
|
||||
bower.json
|
||||
composer.json
|
||||
CONTRIBUTING.md
|
||||
gulpfile.js
|
||||
meteor-README.md
|
||||
package.js
|
||||
sache.json
|
||||
test
|
||||
.editorconfig
|
||||
.versions
|
||||
.babelrc
|
||||
yarn.lock
|
|
@ -0,0 +1,409 @@
|
|||
# The following scss-lint Linters are not yet supported by sass-lint:
|
||||
# ElsePlacement, PropertyCount, SelectorDepth, UnnecessaryParentReference
|
||||
#
|
||||
# The following settings/values are unsupported by sass-lint:
|
||||
# Linter Indentation, option "allow_non_nested_indentation"
|
||||
# Linter Indentation, option "character"
|
||||
# Linter PropertySortOrder, option "separate_groups"
|
||||
# Linter SpaceBeforeBrace, option "allow_single_line_padding"
|
||||
|
||||
files:
|
||||
include: 'scss/**/*.scss'
|
||||
|
||||
options:
|
||||
formatter: stylish
|
||||
merge-default-rules: false
|
||||
|
||||
rules:
|
||||
border-zero:
|
||||
- 1
|
||||
- convention: '0'
|
||||
|
||||
brace-style:
|
||||
- 1
|
||||
- style: stroustrup
|
||||
- allow-single-line: true
|
||||
|
||||
class-name-format:
|
||||
- 1
|
||||
- convention: '([a-z0-9]+-?)+'
|
||||
|
||||
clean-import-paths:
|
||||
- 1
|
||||
- filename-extension: false
|
||||
leading-underscore: false
|
||||
|
||||
empty-line-between-blocks:
|
||||
- 1
|
||||
- ignore-single-line-rulesets: true
|
||||
|
||||
extends-before-declarations: 1
|
||||
|
||||
extends-before-mixins: 1
|
||||
|
||||
final-newline:
|
||||
- 1
|
||||
- include: true
|
||||
|
||||
force-attribute-nesting: 1
|
||||
|
||||
force-element-nesting: 1
|
||||
|
||||
force-pseudo-nesting: 1
|
||||
|
||||
function-name-format:
|
||||
- 1
|
||||
- allow-leading-underscore: true
|
||||
convention: hyphenatedlowercase
|
||||
|
||||
hex-length:
|
||||
- 1
|
||||
- style: short
|
||||
|
||||
hex-notation:
|
||||
- 1
|
||||
- style: lowercase
|
||||
|
||||
id-name-format:
|
||||
- 1
|
||||
- convention: '([a-z0-9]+-?)+'
|
||||
|
||||
indentation:
|
||||
- 1
|
||||
- size: 2
|
||||
|
||||
leading-zero:
|
||||
- 1
|
||||
- include: true
|
||||
|
||||
mixin-name-format:
|
||||
- 1
|
||||
- allow-leading-underscore: true
|
||||
convention: hyphenatedlowercase
|
||||
|
||||
mixins-before-declarations: 1
|
||||
|
||||
nesting-depth:
|
||||
- 1
|
||||
- max-depth: 3
|
||||
|
||||
no-color-keywords: 1
|
||||
|
||||
no-color-literals: 1
|
||||
|
||||
no-css-comments: 0
|
||||
|
||||
no-debug: 1
|
||||
|
||||
no-duplicate-properties: 1
|
||||
|
||||
no-empty-rulesets: 1
|
||||
|
||||
no-ids: 1
|
||||
|
||||
no-important: 0
|
||||
|
||||
no-invalid-hex: 1
|
||||
|
||||
no-mergeable-selectors: 1
|
||||
|
||||
no-misspelled-properties:
|
||||
- 1
|
||||
- extra-properties: []
|
||||
|
||||
no-qualifying-elements:
|
||||
- 1
|
||||
- allow-element-with-attribute: false
|
||||
allow-element-with-class: false
|
||||
allow-element-with-id: false
|
||||
|
||||
no-trailing-zero: 1
|
||||
|
||||
no-url-protocols: 1
|
||||
|
||||
no-vendor-prefixes:
|
||||
- 1
|
||||
- ignore-non-standard: true
|
||||
|
||||
placeholder-in-extend: 1
|
||||
|
||||
placeholder-name-format:
|
||||
- 1
|
||||
- convention: '([a-z0-9]+-?)+'
|
||||
|
||||
property-sort-order:
|
||||
- 1
|
||||
-
|
||||
ignore-custom-properties: true
|
||||
order:
|
||||
# Specific - CSS property order
|
||||
# https://gist.github.com/ncoden/d42f55df7c7970f548a02cd3468f9c86
|
||||
|
||||
# Position
|
||||
- 'position'
|
||||
- 'top'
|
||||
- 'right'
|
||||
- 'bottom'
|
||||
- 'left'
|
||||
- 'z-index'
|
||||
|
||||
# Disposition
|
||||
- 'display'
|
||||
|
||||
- 'flex'
|
||||
- 'flex-basis'
|
||||
- 'flex-direction'
|
||||
- 'flex-flow'
|
||||
- 'flex-grow'
|
||||
- 'flex-shrink'
|
||||
- 'flex-wrap'
|
||||
- 'justify-content'
|
||||
- 'order'
|
||||
|
||||
- 'box-align'
|
||||
- 'box-flex'
|
||||
- 'box-orient'
|
||||
- 'box-pack'
|
||||
|
||||
- 'align-content'
|
||||
- 'align-items'
|
||||
- 'align-self'
|
||||
|
||||
- 'columns'
|
||||
- 'column-gap'
|
||||
- 'column-fill'
|
||||
- 'column-rule'
|
||||
- 'column-span'
|
||||
- 'column-count'
|
||||
- 'column-width'
|
||||
|
||||
- 'vertical-align'
|
||||
- 'float'
|
||||
- 'clear'
|
||||
|
||||
# Dimension
|
||||
- 'box-sizing'
|
||||
|
||||
- 'width'
|
||||
- 'min-width'
|
||||
- 'max-width'
|
||||
|
||||
- 'height'
|
||||
- 'min-height'
|
||||
- 'max-height'
|
||||
|
||||
- 'margin'
|
||||
- 'margin-top'
|
||||
- 'margin-right'
|
||||
- 'margin-bottom'
|
||||
- 'margin-left'
|
||||
- 'margin-collapse'
|
||||
- 'margin-top-collapse'
|
||||
- 'margin-right-collapse'
|
||||
- 'margin-bottom-collapse'
|
||||
- 'margin-left-collapse'
|
||||
|
||||
- 'padding'
|
||||
- 'padding-top'
|
||||
- 'padding-right'
|
||||
- 'padding-bottom'
|
||||
- 'padding-left'
|
||||
|
||||
|
||||
# Global appearance
|
||||
- 'appearance'
|
||||
- 'opacity'
|
||||
- 'filter'
|
||||
- 'visibility'
|
||||
|
||||
- 'size'
|
||||
- 'resize'
|
||||
- 'zoom'
|
||||
|
||||
- 'transform'
|
||||
- 'transform-box'
|
||||
- 'transform-origin'
|
||||
- 'transform-style'
|
||||
|
||||
# Border
|
||||
- 'outline'
|
||||
- 'outline-color'
|
||||
- 'outline-offset'
|
||||
- 'outline-style'
|
||||
- 'outline-width'
|
||||
|
||||
- 'border'
|
||||
- 'border-top'
|
||||
- 'border-right'
|
||||
- 'border-bottom'
|
||||
- 'border-left'
|
||||
- 'border-width'
|
||||
- 'border-top-width'
|
||||
- 'border-right-width'
|
||||
- 'border-bottom-width'
|
||||
- 'border-left-width'
|
||||
|
||||
- 'border-style'
|
||||
- 'border-top-style'
|
||||
- 'border-right-style'
|
||||
- 'border-bottom-style'
|
||||
- 'border-left-style'
|
||||
|
||||
- 'border-radius'
|
||||
- 'border-top-left-radius'
|
||||
- 'border-top-right-radius'
|
||||
- 'border-bottom-right-radius'
|
||||
- 'border-bottom-left-radius'
|
||||
- 'border-radius-topleft'
|
||||
- 'border-radius-topright'
|
||||
- 'border-radius-bottomright'
|
||||
- 'border-radius-bottomleft'
|
||||
|
||||
- 'border-color'
|
||||
- 'border-top-color'
|
||||
- 'border-right-color'
|
||||
- 'border-bottom-color'
|
||||
- 'border-left-color'
|
||||
|
||||
- 'border-collapse'
|
||||
- 'border-spacing'
|
||||
|
||||
# Background
|
||||
- 'background'
|
||||
- 'background-image'
|
||||
- 'background-color'
|
||||
- 'background-attachment'
|
||||
- 'background-clip'
|
||||
- 'background-origin'
|
||||
- 'background-position'
|
||||
- 'background-repeat'
|
||||
- 'background-size'
|
||||
|
||||
# Shadow
|
||||
- 'box-shadow'
|
||||
|
||||
# Animation
|
||||
- 'animation'
|
||||
- 'animation-delay'
|
||||
- 'animation-duration'
|
||||
- 'animation-iteration-count'
|
||||
- 'animation-name'
|
||||
- 'animation-play-state'
|
||||
- 'animation-timing-function'
|
||||
- 'animation-fill-mode'
|
||||
|
||||
- 'transition'
|
||||
- 'transition-delay'
|
||||
- 'transition-duration'
|
||||
- 'transition-property'
|
||||
- 'transition-timing-function'
|
||||
|
||||
|
||||
# Content
|
||||
- 'content'
|
||||
|
||||
- 'list-style'
|
||||
- 'list-style-image'
|
||||
- 'list-style-position'
|
||||
- 'list-style-type'
|
||||
|
||||
- 'overflow'
|
||||
- 'overflow-x'
|
||||
- 'overflow-y'
|
||||
- 'clip'
|
||||
|
||||
# Text
|
||||
- 'font'
|
||||
- 'font-family'
|
||||
- 'font-size'
|
||||
- 'font-smoothing'
|
||||
- 'osx-font-smoothing'
|
||||
- 'font-style'
|
||||
- 'font-variant'
|
||||
- 'font-weight'
|
||||
- 'src'
|
||||
|
||||
- 'word-spacing'
|
||||
- 'letter-spacing'
|
||||
- 'line-height'
|
||||
|
||||
- 'color'
|
||||
- 'direction'
|
||||
- 'text-align'
|
||||
- 'text-decoration'
|
||||
- 'text-indent'
|
||||
- 'text-overflow'
|
||||
- 'text-rendering'
|
||||
- 'text-size-adjust'
|
||||
- 'text-shadow'
|
||||
- 'text-transform'
|
||||
|
||||
- 'white-space'
|
||||
- 'word-break'
|
||||
- 'word-wrap'
|
||||
- 'hyphens'
|
||||
- 'quotes'
|
||||
|
||||
# Divers
|
||||
- 'pointer-events'
|
||||
- 'cursor'
|
||||
|
||||
- 'backface-visibility'
|
||||
- 'caption-side'
|
||||
- 'empty-cells'
|
||||
- 'table-layout'
|
||||
- 'user-select'
|
||||
|
||||
- 'interpolation-mode'
|
||||
- 'marks'
|
||||
- 'page'
|
||||
- 'set-link-source'
|
||||
- 'unicode-bidi'
|
||||
- 'speak'
|
||||
|
||||
quotes:
|
||||
- 1
|
||||
- style: single
|
||||
|
||||
shorthand-values: 1
|
||||
|
||||
single-line-per-selector: 0
|
||||
|
||||
space-after-bang:
|
||||
- 1
|
||||
- include: false
|
||||
|
||||
space-after-colon:
|
||||
- 1
|
||||
- include: true
|
||||
|
||||
space-after-comma: 1
|
||||
|
||||
space-before-bang:
|
||||
- 1
|
||||
- include: true
|
||||
|
||||
space-before-brace:
|
||||
- 1
|
||||
- include: true
|
||||
|
||||
space-before-colon: 1
|
||||
|
||||
space-between-parens:
|
||||
- 1
|
||||
- include: false
|
||||
|
||||
trailing-semicolon: 1
|
||||
|
||||
url-quotes: 1
|
||||
|
||||
variable-for-property:
|
||||
- 0
|
||||
- properties: []
|
||||
|
||||
variable-name-format:
|
||||
- 1
|
||||
- allow-leading-underscore: true
|
||||
convention: hyphenatedlowercase
|
||||
|
||||
zero-unit: 1
|
|
@ -0,0 +1,9 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
install:
|
||||
- npm install -g bower browserstack-runner
|
||||
- npm install
|
||||
script: npm run test:ci
|
||||
notifications:
|
||||
email: false
|
|
@ -0,0 +1,14 @@
|
|||
babel-compiler@6.6.4
|
||||
babel-runtime@0.1.8
|
||||
caching-compiler@1.0.4
|
||||
ecmascript@0.4.3
|
||||
ecmascript-runtime@0.2.10
|
||||
fourseven:scss@4.5.4
|
||||
jquery@1.11.8
|
||||
meteor@1.1.14
|
||||
modules@0.6.1
|
||||
modules-runtime@0.6.3
|
||||
promise@0.6.7
|
||||
random@1.0.9
|
||||
underscore@1.0.8
|
||||
zurb:foundation-sites@6.3.0
|
|
@ -0,0 +1,55 @@
|
|||
# Foundation Contributing Guidelines
|
||||
|
||||
Although Foundation is maintained by ZURB, it’s also a community effort. Whether it’s bug fixing, feature development, or contributions to the ecosystem, designers and developers from all over the world help make Foundation the most advanced framework in the world.
|
||||
|
||||
A select group of our contributors have been dubbed *Yetinauts*. They have direct write access to the codebase and support the core Foundation team on the development of the framework. Are you interested in making your mark on the Foundation framework? Whether you’re just submitting bugs or helping us write new features, there are many ways to contribute to Foundation.
|
||||
|
||||
## Terms
|
||||
|
||||
- The **community** is anyone commenting on issues or opening pull requests. That includes you!
|
||||
- A **Yetinaut** is anyone with write access to the repository.
|
||||
- The **Core Team** is anyone on the Foundation Team.
|
||||
|
||||
## Issues
|
||||
|
||||
Open an issue for any problem you have with the framework. If there's anything missing from your issue, such as extra context, a code sample, etc. a team member will ask for more info in the comments.
|
||||
|
||||
Support requests are generally better suited for the [Foundation Forum](http://foundation.zurb.com/forum), while GitHub is more appropriate for bugs. If you aren’t sure if your issue is a bug or not, don’t worry! Post your problem on GitHub and the team will help you along. Every participant is expected to follow the project's [Code of Conduct](code-of-conduct.md) so please be courteous and respectful.
|
||||
|
||||
## Contributions
|
||||
|
||||
All new features and bug fixes should be submitted as pull requests, so the community can review and discuss them. Core Team members can commit directly to the repository for very small changes, but should generally also submit new code as a pull request.
|
||||
|
||||
When you submit a pull request, @mention a few people you’d like to help you review it. Once those people have signed off on it, the pull request can be merged! Core Team members will handle the merge itself.
|
||||
|
||||
## Git Workflow
|
||||
|
||||
Foundation uses a git workflow close to [GitFlow](http://nvie.com/posts/a-successful-git-branching-model/). The workflow relies on three branches:
|
||||
- **`master`**: The stable branch. It only contains the latest stable version released. Pull requests for docs improvements can be opened on it.
|
||||
- **`develop`**: The developing branch is used to prepare the next minor/major version. It always contains all the new features and bug fixes previously made, and constitutes the most up-to-date version of Foundation. Almost every pull request should be opened on this branch. When a new version is released, it is merged on `master`, a support branch is created, and `develop` now targets the next version.
|
||||
- **`support/*`**: Support branches are used to support the previous versions (i.e. `support/6.3` for `v6.3.0`) and prepare patches (i.e. `v6.3.1`). When a bug fix is compatible with supported versions, it is also merged on their support branches and patch versions can be released. If a fix is not compatible with `develop`, a pull request can be opened on the latest compatible and supported version.
|
||||
|
||||
This git workflow was adopted as of `v6.3`, so `v6.2` and previous versions are not supported.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
If you aren't sure how a feature should be implemented, we recommend checking out our [standards document](https://github.com/zurb/foundation-standards), which outlines every aspect of writing framework features, from Sass to JavaScript.
|
||||
|
||||
## Becoming a Yetinaut
|
||||
|
||||
Want to join our crack team of Yetinauts? The Core Team is inviting active community members to become Yetinauts on a case-by-case basis. If you want to become a contributor, engage the community on the Foundation Forum, help us close issues on GitHub, and review pull requests from other contributors.
|
||||
|
||||
If you’ve made substantial contributions to a Foundation framework and haven’t heard from us yet, you can reach out at foundation@zurb.com.
|
||||
|
||||
Contributors are expected to:
|
||||
|
||||
- Engage the community on GitHub by responding to and tagging issues.
|
||||
- Write pull requests to address bugs and feature requests.
|
||||
- Help in reviewing pull requests from users, contributors, and the Core Team.
|
||||
- Follow the guidelines outlined in this document.
|
||||
|
||||
Here are some example contributions from some of our awesome team members:
|
||||
|
||||
- Colin Marshall converted our Sass unit tests to a newer test runner called True.
|
||||
- Andy Cochran reworked the CSS for button groups to fix issues with stacking and border radii.
|
||||
- designerno1 developed the Equalize by Row feature for the Equalizer plugin.
|
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) 2011-2018 ZURB, Inc.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,57 @@
|
|||
# [Foundation for Sites](http://foundation.zurb.com)
|
||||
|
||||
[![Build Status](https://travis-ci.org/zurb/foundation-sites.svg?branch=develop)](https://travis-ci.org/zurb/foundation-sites)
|
||||
[![npm version](https://badge.fury.io/js/foundation-sites.svg)](https://badge.fury.io/js/foundation-sites)
|
||||
[![Bower version](https://badge.fury.io/bo/foundation-sites.svg)](https://badge.fury.io/bo/foundation-sites)
|
||||
[![Gem Version](https://badge.fury.io/rb/foundation-rails.svg)](https://badge.fury.io/rb/foundation-rails)
|
||||
[![CDNJS](https://img.shields.io/cdnjs/v/foundation.svg)](https://cdnjs.com/libraries/foundation)
|
||||
[![dependencies Status](https://david-dm.org/zurb/foundation-sites/status.svg)](https://david-dm.org/zurb/foundation-sites)
|
||||
[![devDependencies Status](https://david-dm.org/zurb/foundation-sites/dev-status.svg)](https://david-dm.org/zurb/foundation-sites?type=dev)
|
||||
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zurb/foundation-sites?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
Foundation is the most advanced responsive front-end framework in the world. Quickly go from prototype to production, building sites or apps that work on any kind of device with Foundation. Includes a fully customizable, responsive grid, a large library of Sass mixins, commonly used JavaScript plugins, and full accessibility support.
|
||||
|
||||
## Getting Started
|
||||
|
||||
The quickest way to get started is with the [basic CSS download](http://foundation.zurb.com/sites/download/). You can get versions with every component, essential ones only, or a custom build.
|
||||
|
||||
If you're a Sass user, we have two starter project templates, the [Basic Template](https://github.com/zurb/foundation-sites-template) and the [ZURB Template](https://github.com/zurb/foundation-zurb-template). You can install them by manually downloading them from GitHub, or using the [Foundation CLI](https://github.com/zurb/foundation-cli).
|
||||
|
||||
Lastly, if you're rolling your own setup, you can install Foundation through a variety of [package managers](http://foundation.zurb.com/sites/docs/installation.html#package-managers).
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation can be found at <https://foundation.zurb.com/sites/docs>. To run the documentation locally on your machine, you need [Node.js](https://nodejs.org/en/) installed on your computer. (Your Node.js version must be **4.0** or higher.)
|
||||
|
||||
Run these commands to set up the documentation:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/zurb/foundation-sites
|
||||
cd foundation-sites
|
||||
npm install
|
||||
```
|
||||
|
||||
Then run `npm start` to compile the documentation. When it finishes, a new browser window will open pointing to a BrowserSync server displaying the documentation.
|
||||
|
||||
## Training
|
||||
|
||||
Want the guided tour to Foundation from the team that built it? The ZURB team offers comprehensive training courses for developers of all skill levels. If you're new to Foundation, check out the [Introduction to Foundation Course](http://zurb.com/university/foundation-intro?utm_source=Github%20Repo&utm_medium=website&utm_campaign=readme&utm_content=readme%20training%20link) to kickstart your skills, amplify your productivity, and get a comprehensive overview of everything Foundation has to offer. More Advanced users should check out the [Advanced Foundation Course](http://zurb.com/university/advanced-foundation-training?utm_source=Github%20Repo&utm_medium=website&utm_campaign=readme&utm_content=readme%20training%20link) to learn the Advanced skills that ZURB uses to deliver quality client work in short timeframes.
|
||||
|
||||
## Testing
|
||||
|
||||
Foundation has three kinds of tests: JavaScript, Sass, and visual regression. Refer to our [testing guide](https://github.com/zurb/foundation-sites/wiki/Testing-Guide) for more details.
|
||||
|
||||
These commands will run the various tests:
|
||||
|
||||
- `npm run test:sass`
|
||||
- `npm run test:javascript:phantomjs`
|
||||
- `npm run test:visual`
|
||||
|
||||
Testing Supported By<br/>
|
||||
<img width="160" src="http://foundation.zurb.com/sites/docs/assets/img/logos/browser-stack.svg" alt="BrowserStack"/>
|
||||
|
||||
## Contributing
|
||||
|
||||
Check out our [contributing guide](http://foundation.zurb.com/develop/contribute.html) to learn how you can contribute to Foundation. You can also browse the [Help Wanted](https://github.com/zurb/foundation-sites/labels/help%20wanted) tag in our issue tracker to find things to do.
|
||||
|
||||
Copyright (c) 2018 ZURB, Inc.
|
|
@ -0,0 +1,3 @@
|
|||
@import 'normalize/variables';
|
||||
@import 'normalize/vertical-rhythm';
|
||||
@import 'normalize/normalize-mixin';
|
|
@ -0,0 +1,11 @@
|
|||
// Import Now
|
||||
//
|
||||
// If you import this module directly, it will immediately output all the CSS
|
||||
// needed to normalize default HTML elements across all browsers.
|
||||
//
|
||||
// ```
|
||||
// @import "normalize/import-now";
|
||||
// ```
|
||||
|
||||
@import '../normalize';
|
||||
@include normalize();
|
|
@ -0,0 +1,676 @@
|
|||
// Helper function for the normalize() mixin.
|
||||
@function _normalize-include($section, $exclude: null) {
|
||||
// Initialize the global variables needed by this function.
|
||||
@if not global_variable_exists(_normalize-include) {
|
||||
$_normalize-include: () !global;
|
||||
$_normalize-exclude: () !global;
|
||||
}
|
||||
// Since we are given 2 parameters, set the global variables.
|
||||
@if $exclude != null {
|
||||
$include: $section;
|
||||
// Sass doesn't have static variables, so the work-around is to stuff these
|
||||
// values into global variables so we can access them in future calls.
|
||||
$_normalize-include: if(type-of($include) == 'list', $include, ($include)) !global;
|
||||
$_normalize-exclude: if(type-of($exclude) == 'list', $exclude, ($exclude)) !global;
|
||||
@return true;
|
||||
}
|
||||
|
||||
// Check if $section is in the $include list.
|
||||
@if index($_normalize-include, $section) {
|
||||
@return true;
|
||||
}
|
||||
// If $include is set to (all), make sure $section is not in $exclude.
|
||||
@else if not index($_normalize-exclude, $section) and index($_normalize-include, all) {
|
||||
@return true;
|
||||
}
|
||||
@return false;
|
||||
}
|
||||
|
||||
@mixin normalize($include: (all), $exclude: ()) {
|
||||
// Initialize the helper function by passing it this mixin's parameters.
|
||||
$init: _normalize-include($include, $exclude);
|
||||
|
||||
// If we've customized any font variables, we'll need extra properties.
|
||||
@if $base-font-size != 16px
|
||||
or $base-line-height != 24px
|
||||
or $base-unit != 'em'
|
||||
or $h1-font-size != 2 * $base-font-size
|
||||
or $h2-font-size != 1.5 * $base-font-size
|
||||
or $h3-font-size != 1.17 * $base-font-size
|
||||
or $h4-font-size != 1 * $base-font-size
|
||||
or $h5-font-size != 0.83 * $base-font-size
|
||||
or $h6-font-size != 0.67 * $base-font-size {
|
||||
$normalize-vertical-rhythm: true !global;
|
||||
}
|
||||
|
||||
/*! normalize-scss | MIT/GPLv2 License | bit.ly/normalize-scss */
|
||||
|
||||
@if _normalize-include(document) {
|
||||
/* Document
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Change the default font family in all browsers (opinionated).
|
||||
* 2. Correct the line height in all browsers.
|
||||
* 3. Prevent adjustments of font size after orientation changes in
|
||||
* IE on Windows Phone and in iOS.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: $base-font-family; /* 1 */
|
||||
@if $normalize-vertical-rhythm {
|
||||
// Correct old browser bug that prevented accessible resizing of text
|
||||
// when root font-size is set with px or em.
|
||||
font-size: ($base-font-size / 16px) * 100%;
|
||||
line-height: ($base-line-height / $base-font-size) * 1em; /* 2 */
|
||||
}
|
||||
@else {
|
||||
line-height: 1.15; /* 2 */
|
||||
}
|
||||
-ms-text-size-adjust: 100%; /* 3 */
|
||||
-webkit-text-size-adjust: 100%; /* 3 */
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(sections) {
|
||||
/* Sections
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the margin in all browsers (opinionated).
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
footer,
|
||||
header,
|
||||
nav,
|
||||
section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
@include normalize-font-size($h1-font-size);
|
||||
@if $normalize-vertical-rhythm {
|
||||
@include normalize-line-height($h1-font-size);
|
||||
}
|
||||
|
||||
@if $normalize-vertical-rhythm {
|
||||
/* Set 1 unit of vertical rhythm on the top and bottom margins. */
|
||||
@include normalize-margin(1 0, $h1-font-size);
|
||||
}
|
||||
@else {
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
}
|
||||
|
||||
@if $normalize-vertical-rhythm {
|
||||
h2 {
|
||||
@include normalize-font-size($h2-font-size);
|
||||
@include normalize-line-height($h2-font-size);
|
||||
@include normalize-margin(1 0, $h2-font-size);
|
||||
}
|
||||
|
||||
h3 {
|
||||
@include normalize-font-size($h3-font-size);
|
||||
@include normalize-line-height($h3-font-size);
|
||||
@include normalize-margin(1 0, $h3-font-size);
|
||||
}
|
||||
|
||||
h4 {
|
||||
@include normalize-font-size($h4-font-size);
|
||||
@include normalize-line-height($h4-font-size);
|
||||
@include normalize-margin(1 0, $h4-font-size);
|
||||
}
|
||||
|
||||
h5 {
|
||||
@include normalize-font-size($h5-font-size);
|
||||
@include normalize-line-height($h5-font-size);
|
||||
@include normalize-margin(1 0, $h5-font-size);
|
||||
}
|
||||
|
||||
h6 {
|
||||
@include normalize-font-size($h6-font-size);
|
||||
@include normalize-line-height($h6-font-size);
|
||||
@include normalize-margin(1 0, $h6-font-size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(grouping) {
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
@if $normalize-vertical-rhythm {
|
||||
/**
|
||||
* Set 1 unit of vertical rhythm on the top and bottom margin.
|
||||
*/
|
||||
|
||||
blockquote {
|
||||
@include normalize-margin(1 $indent-amount);
|
||||
}
|
||||
|
||||
dl,
|
||||
ol,
|
||||
ul {
|
||||
@include normalize-margin(1 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn off margins on nested lists.
|
||||
*/
|
||||
|
||||
ol,
|
||||
ul {
|
||||
ol,
|
||||
ul {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0 0 0 $indent-amount;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
padding: 0 0 0 $indent-amount;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
figcaption,
|
||||
figure {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct margin in IE 8.
|
||||
*/
|
||||
|
||||
figure {
|
||||
@if $normalize-vertical-rhythm {
|
||||
@include normalize-margin(1 $indent-amount);
|
||||
}
|
||||
@else {
|
||||
margin: 1em $indent-amount;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
|
||||
hr {
|
||||
box-sizing: content-box; /* 1 */
|
||||
height: 0; /* 1 */
|
||||
overflow: visible; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE.
|
||||
*/
|
||||
|
||||
main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@if $normalize-vertical-rhythm {
|
||||
/**
|
||||
* Set 1 unit of vertical rhythm on the top and bottom margin.
|
||||
*/
|
||||
|
||||
p,
|
||||
pre {
|
||||
@include normalize-margin(1 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(links) {
|
||||
/* Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Remove the gray background on active links in IE 10.
|
||||
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
|
||||
*/
|
||||
|
||||
a {
|
||||
background-color: transparent; /* 1 */
|
||||
-webkit-text-decoration-skip: objects; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the outline on focused links when they are also active or hovered
|
||||
* in all browsers (opinionated).
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(text) {
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Remove the bottom border in Firefox 39-.
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: none; /* 1 */
|
||||
text-decoration: underline; /* 2 */
|
||||
text-decoration: underline dotted; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font style in Android 4.3-.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct background and color in IE 9-.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background-color: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(embedded) {
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
audio,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in iOS 4-7.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the border on images inside links in IE 10-.
|
||||
*/
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the overflow in IE.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(forms) {
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Change the font styles in all browsers (opinionated).
|
||||
* 2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: $base-font-family; /* 1 */
|
||||
font-size: 100%; /* 1 */
|
||||
@if $normalize-vertical-rhythm {
|
||||
line-height: ($base-line-height / $base-font-size) * 1em; /* 1 */
|
||||
}
|
||||
@else {
|
||||
line-height: 1.15; /* 1 */
|
||||
}
|
||||
margin: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in IE.
|
||||
*/
|
||||
|
||||
button {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select { /* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
|
||||
* controls in Android 4.
|
||||
* 2. Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
html [type="button"], /* 1 */
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
}
|
||||
|
||||
button,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
|
||||
/**
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
|
||||
&::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
|
||||
&:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in Edge.
|
||||
*/
|
||||
|
||||
input {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in IE 10-.
|
||||
* 2. Remove the padding in IE 10-.
|
||||
*/
|
||||
|
||||
[type="checkbox"],
|
||||
[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
|
||||
/**
|
||||
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
&::-webkit-search-cancel-button,
|
||||
&::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the border, margin, and padding in all browsers (opinionated).
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
box-sizing: border-box; /* 1 */
|
||||
display: table; /* 1 */
|
||||
max-width: 100%; /* 1 */
|
||||
padding: 0; /* 3 */
|
||||
color: inherit; /* 2 */
|
||||
white-space: normal; /* 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct display in IE 9-.
|
||||
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
progress {
|
||||
display: inline-block; /* 1 */
|
||||
vertical-align: baseline; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default vertical scrollbar in IE.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(interactive) {
|
||||
/* Interactive
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Add the correct display in Edge, IE, and Firefox.
|
||||
*/
|
||||
|
||||
details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct display in all browsers.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
menu {
|
||||
display: block;
|
||||
|
||||
@if $normalize-vertical-rhythm {
|
||||
/*
|
||||
* 1. Set 1 unit of vertical rhythm on the top and bottom margin.
|
||||
* 2. Set consistent space for the list style image.
|
||||
*/
|
||||
|
||||
@include normalize-margin(1 0); /* 1 */
|
||||
padding: 0 0 0 $indent-amount; /* 2 */
|
||||
|
||||
/**
|
||||
* Turn off margins on nested lists.
|
||||
*/
|
||||
|
||||
menu &,
|
||||
ol &,
|
||||
ul & {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(scripting) {
|
||||
/* Scripting
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
canvas {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE.
|
||||
*/
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@if _normalize-include(hidden) {
|
||||
/* Hidden
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10-.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// Variables
|
||||
//
|
||||
// You can override the default values by setting the variables in your Sass
|
||||
// before importing the normalize-scss library.
|
||||
|
||||
// The font size set on the root html element.
|
||||
$base-font-size: 16px !default;
|
||||
|
||||
// The base line height determines the basic unit of vertical rhythm.
|
||||
$base-line-height: 24px !default;
|
||||
|
||||
// The length unit in which to output vertical rhythm values.
|
||||
// Supported values: px, em, rem.
|
||||
$base-unit: 'em' !default;
|
||||
|
||||
// The default font family.
|
||||
$base-font-family: sans-serif !default;
|
||||
|
||||
// The font sizes for h1-h6.
|
||||
$h1-font-size: 2 * $base-font-size !default;
|
||||
$h2-font-size: 1.5 * $base-font-size !default;
|
||||
$h3-font-size: 1.17 * $base-font-size !default;
|
||||
$h4-font-size: 1 * $base-font-size !default;
|
||||
$h5-font-size: 0.83 * $base-font-size !default;
|
||||
$h6-font-size: 0.67 * $base-font-size !default;
|
||||
|
||||
// The amount lists and blockquotes are indented.
|
||||
$indent-amount: 40px !default;
|
||||
|
||||
// The following variable controls whether normalize-scss will output
|
||||
// font-sizes, line-heights and block-level top/bottom margins that form a basic
|
||||
// vertical rhythm on the page, which differs from the original Normalize.css.
|
||||
// However, changing any of the variables above will cause
|
||||
// $normalize-vertical-rhythm to be automatically set to true.
|
||||
$normalize-vertical-rhythm: false !default;
|
|
@ -0,0 +1,61 @@
|
|||
//
|
||||
// Vertical Rhythm
|
||||
//
|
||||
// This is the minimal amount of code needed to create vertical rhythm in our
|
||||
// CSS. If you are looking for a robust solution, look at the excellent Typey
|
||||
// library. @see https://github.com/jptaranto/typey
|
||||
|
||||
@function normalize-rhythm($value, $relative-to: $base-font-size, $unit: $base-unit) {
|
||||
@if unit($value) != px {
|
||||
@error "The normalize vertical-rhythm module only supports px inputs. The typey library is better.";
|
||||
}
|
||||
@if $unit == rem {
|
||||
@return ($value / $base-font-size) * 1rem;
|
||||
}
|
||||
@else if $unit == em {
|
||||
@return ($value / $relative-to) * 1em;
|
||||
}
|
||||
@else { // $unit == px
|
||||
@return $value;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin normalize-font-size($value, $relative-to: $base-font-size) {
|
||||
@if unit($value) != 'px' {
|
||||
@error "normalize-font-size() only supports px inputs. The typey library is better.";
|
||||
}
|
||||
font-size: normalize-rhythm($value, $relative-to);
|
||||
}
|
||||
|
||||
@mixin normalize-rhythm($property, $values, $relative-to: $base-font-size) {
|
||||
$value-list: $values;
|
||||
$sep: space;
|
||||
@if type-of($values) == 'list' {
|
||||
$sep: list-separator($values);
|
||||
}
|
||||
@else {
|
||||
$value-list: append((), $values);
|
||||
}
|
||||
|
||||
$normalized-values: ();
|
||||
@each $value in $value-list {
|
||||
@if unitless($value) and $value != 0 {
|
||||
$value: $value * normalize-rhythm($base-line-height, $relative-to);
|
||||
}
|
||||
$normalized-values: append($normalized-values, $value, $sep);
|
||||
}
|
||||
#{$property}: $normalized-values;
|
||||
}
|
||||
|
||||
@mixin normalize-margin($values, $relative-to: $base-font-size) {
|
||||
@include normalize-rhythm(margin, $values, $relative-to);
|
||||
}
|
||||
|
||||
@mixin normalize-line-height($font-size, $min-line-padding: 2px) {
|
||||
$lines: ceil($font-size / $base-line-height);
|
||||
// If lines are cramped include some extra leading.
|
||||
@if ($lines * $base-line-height - $font-size) < ($min-line-padding * 2) {
|
||||
$lines: $lines + 1;
|
||||
}
|
||||
@include normalize-rhythm(line-height, $lines, $font-size);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
///
|
||||
/// Returns whether `$list` contains `$value`.
|
||||
///
|
||||
/// @ignore Documentation: http://at-import.github.io/SassyLists/documentation/#function-sl-contain
|
||||
///
|
||||
/// @param {List} $list - list to check
|
||||
/// @param {*} $value - value to look for
|
||||
///
|
||||
/// @example
|
||||
/// sl-contain(a b c, a)
|
||||
/// // true
|
||||
///
|
||||
/// @example
|
||||
/// sl-contain(a b c, z)
|
||||
/// // false
|
||||
///
|
||||
/// @return {Bool}
|
||||
///
|
||||
|
||||
@function sl-contain($list, $value) {
|
||||
@return not not index($list, $value);
|
||||
}
|
||||
|
||||
///
|
||||
/// @requires sl-contain
|
||||
/// @alias sl-contain
|
||||
///
|
||||
|
||||
@function sl-include($list, $value) {
|
||||
@return sl-contain($list, $value);
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/// Removes all false and null values from `$list`.
|
||||
///
|
||||
/// @ignore Documentation: http://at-import.github.io/SassyLists/documentation/#function-sl-purge
|
||||
///
|
||||
/// @requires sl-is-true
|
||||
/// @requires sl-to-list
|
||||
///
|
||||
/// @param {List} $list - list to purge
|
||||
///
|
||||
/// @example
|
||||
/// sl-purge(null a false b)
|
||||
/// // a b
|
||||
///
|
||||
/// @return {List}
|
||||
///
|
||||
|
||||
@function sl-purge($list) {
|
||||
$_: sl-missing-dependencies('sl-is-true', 'sl-to-list');
|
||||
|
||||
$result: ();
|
||||
|
||||
@each $item in $list {
|
||||
@if sl-is-true($item) {
|
||||
$result: append($result, $item, list-separator($list));
|
||||
}
|
||||
}
|
||||
|
||||
@return sl-to-list($result);
|
||||
}
|
||||
|
||||
///
|
||||
/// @requires sl-purge
|
||||
/// @alias sl-purge
|
||||
///
|
||||
|
||||
@function sl-clean($list) {
|
||||
@return sl-purge($list);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
///
|
||||
/// Removes value(s) `$value` from `$list`.
|
||||
///
|
||||
/// @ignore Documentation: http://at-import.github.io/SassyLists/documentation/#function-sl-remove
|
||||
///
|
||||
/// @requires sl-replace
|
||||
///
|
||||
/// @param {List} $list - list to update
|
||||
/// @param {*} $value - value to remove
|
||||
///
|
||||
/// @example
|
||||
/// sl-remove(a b c, a)
|
||||
/// // b c
|
||||
///
|
||||
/// @return {List}
|
||||
///
|
||||
|
||||
@function sl-remove($list, $value) {
|
||||
$_: sl-missing-dependencies('sl-replace');
|
||||
|
||||
@return sl-replace($list, $value, null);
|
||||
}
|
||||
|
||||
///
|
||||
/// @requires sl-remove
|
||||
/// @alias sl-remove
|
||||
///
|
||||
|
||||
@function sl-without($list, $value) {
|
||||
@return sl-remove($list, $value);
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
///
|
||||
/// Replaces `$old` by `$new` in `$list`.
|
||||
///
|
||||
/// @ignore Documentation: http://at-import.github.io/SassyLists/documentation/#function-sl-replace
|
||||
///
|
||||
/// @requires sl-is-true
|
||||
/// @requires sl-purge
|
||||
/// @requires sl-to-list
|
||||
///
|
||||
/// @param {List} $list - list to update
|
||||
/// @param {*} $old - value to replace
|
||||
/// @param {*} $value - new value for $old
|
||||
///
|
||||
/// @example
|
||||
/// sl-replace(a b c, b, z)
|
||||
/// // a z c
|
||||
///
|
||||
/// @example
|
||||
/// sl-replace(a b c, y, z)
|
||||
/// // a b c
|
||||
///
|
||||
/// @return {List}
|
||||
///
|
||||
|
||||
@function sl-replace($list, $old, $value) {
|
||||
$_: sl-missing-dependencies('sl-is-true', 'sl-purge', 'sl-to-list');
|
||||
|
||||
$running: true;
|
||||
|
||||
@while $running {
|
||||
$index: index($list, $old);
|
||||
|
||||
@if not $index {
|
||||
$running: false;
|
||||
}
|
||||
|
||||
@else {
|
||||
$list: set-nth($list, $index, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$list: if(sl-is-true($value), $list, sl-purge($list));
|
||||
|
||||
@return sl-to-list($list);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
///
|
||||
/// Casts `$value` into a list.
|
||||
///
|
||||
/// @ignore Documentation: http://at-import.github.io/SassyLists/documentation/#function-sl-to-list
|
||||
///
|
||||
/// @param {*} $value - value to cast to list
|
||||
/// @param {String} $separator [space] - separator to use
|
||||
///
|
||||
/// @example
|
||||
/// sl-to-list(a b c, comma)
|
||||
/// // a, b, c
|
||||
///
|
||||
/// @return {List}
|
||||
///
|
||||
|
||||
@function sl-to-list($value, $separator: list-separator($value)) {
|
||||
@return join((), $value, $separator);
|
||||
}
|
||||
|
||||
///
|
||||
/// @requires sl-to-list
|
||||
/// @alias sl-to-list
|
||||
///
|
||||
|
||||
@function sl-listify($value) {
|
||||
@return sl-to-list($value);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
///
|
||||
/// Checks whether `$functions` exist in global scope.
|
||||
///
|
||||
/// @access private
|
||||
///
|
||||
/// @param {ArgList} $functions - list of functions to check for
|
||||
///
|
||||
/// @return {Bool} Whether or not there are missing dependencies
|
||||
///
|
||||
|
||||
@function sl-missing-dependencies($functions...) {
|
||||
$missing-dependencies: ();
|
||||
|
||||
@each $function in $functions {
|
||||
@if not function-exists($function) {
|
||||
$missing-dependencies: append($missing-dependencies, $function, comma);
|
||||
}
|
||||
}
|
||||
|
||||
@if length($missing-dependencies) > 0 {
|
||||
@error 'Unmet dependencies! The following functions are required: #{$missing-dependencies}.';
|
||||
}
|
||||
|
||||
@return length($missing-dependencies) > 0;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
///
|
||||
/// Returns truthiness of `$value`.
|
||||
///
|
||||
/// @access private
|
||||
///
|
||||
/// @param {*} $value - value to check
|
||||
///
|
||||
/// @return {Bool}
|
||||
///
|
||||
|
||||
@function sl-is-true($value) {
|
||||
@return if($value == null, false, $value and $value != null and $value != '' and $value != ());
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
$global-flexbox: false;
|
||||
|
||||
@import '../scss/foundation';
|
||||
|
||||
@include foundation-everything($flex: false);
|
|
@ -0,0 +1,3 @@
|
|||
@import '../scss/foundation';
|
||||
|
||||
@include foundation-everything($prototype: true);
|
|
@ -0,0 +1,5 @@
|
|||
$global-text-direction: rtl;
|
||||
|
||||
@import '../scss/foundation';
|
||||
|
||||
@include foundation-everything;
|
|
@ -0,0 +1,3 @@
|
|||
@import '../scss/foundation';
|
||||
|
||||
@include foundation-everything;
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"name": "foundation-sites",
|
||||
"version": "6.4.3",
|
||||
"license": "MIT",
|
||||
"main": [
|
||||
"scss/foundation.scss",
|
||||
"dist/js/foundation.js"
|
||||
],
|
||||
"ignore": [
|
||||
"config",
|
||||
"docs",
|
||||
"gulp",
|
||||
"lib",
|
||||
"test",
|
||||
"composer.json",
|
||||
"CONTRIBUTING.md",
|
||||
"gulpfile.js",
|
||||
"meteor-README.md",
|
||||
"package.js",
|
||||
"package.json",
|
||||
"sache.json",
|
||||
".editorconfig",
|
||||
".npm",
|
||||
".gitignore",
|
||||
".npmignore",
|
||||
".versions",
|
||||
".babelrc",
|
||||
"yarn.lock"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": ">= 3.0.0",
|
||||
"what-input": "~4.1.3"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"username": "rafibenkual1",
|
||||
"key": "t42z8wSsqUfpumsyRcyV",
|
||||
"test_path": "test/javascript/index.html",
|
||||
"test_framework": "mocha",
|
||||
"browsers": [
|
||||
{
|
||||
"browser": "chrome",
|
||||
"browser_version": "latest",
|
||||
"os": "OS X",
|
||||
"os_version": "Sierra"
|
||||
},
|
||||
{
|
||||
"browser": "firefox",
|
||||
"browser_version": "latest",
|
||||
"os": "Windows",
|
||||
"os_version": "7"
|
||||
},
|
||||
{
|
||||
"browser": "ie",
|
||||
"browser_version": "latest",
|
||||
"os": "Windows",
|
||||
"os_version": "10"
|
||||
},
|
||||
{
|
||||
"browser": "safari",
|
||||
"browser_version": "latest",
|
||||
"os": "OS X",
|
||||
"os_version": "Yosemite"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
# Foundation Community Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as the Foundation team pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
The Foundation team is responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
The Foundation team has the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing Foundation or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by the Foundation team.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at foundation@zurb.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Contributors who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at <http://contributor-covenant.org/version/1/4>.
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "zurb/foundation-sites",
|
||||
"description": "The most advanced responsive front-end framework in the world.",
|
||||
"keywords": [
|
||||
"css",
|
||||
"scss",
|
||||
"sass",
|
||||
"js",
|
||||
"responsive",
|
||||
"mobile-first",
|
||||
"framework"
|
||||
],
|
||||
"homepage": "http://foundation.zurb.com",
|
||||
"authors": [
|
||||
{
|
||||
"name": "ZURB, Inc.",
|
||||
"homepage": "http://zurb.com",
|
||||
"email": "foundation@zurb.com"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"email": "foundation@zurb.com",
|
||||
"issues": "https://github.com/zurb/foundation-sites/issues",
|
||||
"forum": "http://foundation.zurb.com/forum"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"modules": [
|
||||
"xy_grid",
|
||||
"flex_classes",
|
||||
"typography",
|
||||
"button",
|
||||
"forms",
|
||||
"abide",
|
||||
"accordion",
|
||||
"accordion_menu",
|
||||
"badge",
|
||||
"breadcrumbs",
|
||||
"button_group",
|
||||
"card",
|
||||
"callout",
|
||||
"close_button",
|
||||
"menu",
|
||||
"menu_icon",
|
||||
"drilldown_menu",
|
||||
"dropdown",
|
||||
"dropdown_menu",
|
||||
"equalizer",
|
||||
"responsive_embed",
|
||||
"interchange",
|
||||
"label",
|
||||
"magellan",
|
||||
"media_object",
|
||||
"off_canvas",
|
||||
"orbit",
|
||||
"pagination",
|
||||
"progress_bar",
|
||||
"responsive_menu",
|
||||
"responsive_toggle",
|
||||
"reveal",
|
||||
"slider",
|
||||
"sticky",
|
||||
"switch",
|
||||
"table",
|
||||
"tabs",
|
||||
"thumbnail",
|
||||
"title_bar",
|
||||
"toggler",
|
||||
"tooltip",
|
||||
"top_bar",
|
||||
"visibility",
|
||||
"responsive_accordion_tabs",
|
||||
"float"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
# This is the customizer's master module list.
|
||||
# Each item in the list is a module with any of these keys:
|
||||
# - sass: Name of the CSS export. 'grid' becomes '@include foundation-grid;'
|
||||
# - js: Name of the JavaScript file. 'accordion' becomes 'foundation.accordion.js'
|
||||
|
||||
xy_grid:
|
||||
sass: xy-grid-classes
|
||||
|
||||
grid:
|
||||
sass: grid
|
||||
|
||||
flex_grid:
|
||||
sass: flex-grid
|
||||
|
||||
flex_classes:
|
||||
sass: flex-classes
|
||||
|
||||
typography:
|
||||
sass: typography
|
||||
|
||||
button:
|
||||
sass: button
|
||||
|
||||
card:
|
||||
sass: card
|
||||
|
||||
forms:
|
||||
sass: forms
|
||||
|
||||
input_range:
|
||||
sass: range-input
|
||||
|
||||
abide:
|
||||
js: abide
|
||||
|
||||
accordion:
|
||||
sass: accordion
|
||||
js: accordion
|
||||
|
||||
accordion_menu:
|
||||
sass: accordion-menu
|
||||
js: accordionMenu
|
||||
|
||||
badge:
|
||||
sass: badge
|
||||
|
||||
breadcrumbs:
|
||||
sass: breadcrumbs
|
||||
|
||||
button_group:
|
||||
sass: button-group
|
||||
|
||||
callout:
|
||||
sass: callout
|
||||
|
||||
close_button:
|
||||
sass: close-button
|
||||
|
||||
drilldown_menu:
|
||||
sass: drilldown-menu
|
||||
js: drilldown
|
||||
|
||||
dropdown:
|
||||
sass: dropdown
|
||||
js: dropdown
|
||||
|
||||
dropdown_menu:
|
||||
sass: dropdown-menu
|
||||
js: dropdownMenu
|
||||
|
||||
equalizer:
|
||||
js: equalizer
|
||||
|
||||
interchange:
|
||||
js: interchange
|
||||
|
||||
label:
|
||||
sass: label
|
||||
|
||||
magellan:
|
||||
js: magellan
|
||||
|
||||
media_object:
|
||||
sass: media-object
|
||||
|
||||
menu:
|
||||
sass: menu
|
||||
|
||||
menu_icon:
|
||||
sass: menu-icon
|
||||
|
||||
off_canvas:
|
||||
sass: off-canvas
|
||||
js: offcanvas
|
||||
|
||||
orbit:
|
||||
sass: orbit
|
||||
js: orbit
|
||||
|
||||
pagination:
|
||||
sass: pagination
|
||||
|
||||
progress_bar:
|
||||
sass: progress-bar
|
||||
|
||||
progress_element:
|
||||
sass: progress-element
|
||||
|
||||
prototyping_helpers:
|
||||
sass: prototype-classes
|
||||
|
||||
responsive_embed:
|
||||
sass: responsive-embed
|
||||
|
||||
responsive_menu:
|
||||
js: responsiveMenu
|
||||
|
||||
responsive_toggle:
|
||||
js: responsiveToggle
|
||||
|
||||
meter_element:
|
||||
sass: meter-element
|
||||
|
||||
slider:
|
||||
sass: slider
|
||||
js: slider
|
||||
|
||||
smooth_scroll:
|
||||
js: smoothScroll
|
||||
|
||||
sticky:
|
||||
sass: sticky
|
||||
js: sticky
|
||||
|
||||
responsive_accordion_tabs:
|
||||
js: responsiveAccordionTabs
|
||||
|
||||
reveal:
|
||||
sass: reveal
|
||||
js: reveal
|
||||
|
||||
switch:
|
||||
sass: switch
|
||||
|
||||
table:
|
||||
sass: table
|
||||
|
||||
tabs:
|
||||
sass: tabs
|
||||
js: tabs
|
||||
|
||||
thumbnail:
|
||||
sass: thumbnail
|
||||
|
||||
title_bar:
|
||||
sass: title-bar
|
||||
|
||||
toggler:
|
||||
js: toggler
|
||||
|
||||
tooltip:
|
||||
sass: tooltip
|
||||
js: tooltip
|
||||
|
||||
top_bar:
|
||||
sass: top-bar
|
||||
|
||||
visibility:
|
||||
sass: visibility-classes
|
||||
|
||||
float:
|
||||
sass: float-classes
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"modules": [
|
||||
"typography",
|
||||
"xy_grid",
|
||||
"flex_classes",
|
||||
"forms",
|
||||
"button",
|
||||
"callout",
|
||||
"reveal"
|
||||
],
|
||||
"variables": {}
|
||||
}
|
|
@ -0,0 +1,171 @@
|
|||
<!doctype html>
|
||||
<html class="no-js" lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Foundation for Sites</title>
|
||||
<link rel="stylesheet" href="css/foundation.css">
|
||||
<link rel="stylesheet" href="css/app.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="grid-container">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-12 cell">
|
||||
<h1>Welcome to Foundation</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-12 cell">
|
||||
<div class="callout">
|
||||
<h3>We’re stoked you want to try Foundation! </h3>
|
||||
<p>To get going, this file (index.html) includes some basic styles you can modify, play around with, or totally destroy to get going.</p>
|
||||
<p>Once you've exhausted the fun in this document, you should check out:</p>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-4 medium-4 cell">
|
||||
<p><a href="http://foundation.zurb.com/docs">Foundation Documentation</a><br />Everything you need to know about using the framework.</p>
|
||||
</div>
|
||||
<div class="large-4 medium-4 cell">
|
||||
<p><a href="http://zurb.com/university/code-skills">Foundation Code Skills</a><br />These online courses offer you a chance to better understand how Foundation works and how you can master it to create awesome projects.</p>
|
||||
</div>
|
||||
<div class="large-4 medium-4 cell">
|
||||
<p><a href="http://foundation.zurb.com/forum">Foundation Forum</a><br />Join the Foundation community to ask a question or show off your knowlege.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-4 medium-4 medium-push-2 cell">
|
||||
<p><a href="http://github.com/zurb/foundation">Foundation on Github</a><br />Latest code, issue reports, feature requests and more.</p>
|
||||
</div>
|
||||
<div class="large-4 medium-4 medium-pull-2 cell">
|
||||
<p><a href="https://twitter.com/ZURBfoundation">@zurbfoundation</a><br />Ping us on Twitter if you have questions. When you build something with this we'd love to see it (and send you a totally boss sticker).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-8 medium-8 cell">
|
||||
<h5>Here’s your basic grid:</h5>
|
||||
<!-- Grid Example -->
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-12 cell">
|
||||
<div class="primary callout">
|
||||
<p><strong>This is a twelve cell section in a grid-x.</strong> Each of these includes a div.callout element so you can see where the cell are - it's not required at all for the grid.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-6 medium-6 cell">
|
||||
<div class="primary callout">
|
||||
<p>Six cell</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-6 medium-6 cell">
|
||||
<div class="primary callout">
|
||||
<p>Six cell</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-4 medium-4 small-4 cell">
|
||||
<div class="primary callout">
|
||||
<p>Four cell</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-4 medium-4 small-4 cell">
|
||||
<div class="primary callout">
|
||||
<p>Four cell</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-4 medium-4 small-4 cell">
|
||||
<div class="primary callout">
|
||||
<p>Four cell</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<h5>We bet you’ll need a form somewhere:</h5>
|
||||
<form>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-12 cell">
|
||||
<label>Input Label</label>
|
||||
<input type="text" placeholder="large-12.cell" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-4 medium-4 cell">
|
||||
<label>Input Label</label>
|
||||
<input type="text" placeholder="large-4.cell" />
|
||||
</div>
|
||||
<div class="large-4 medium-4 cell">
|
||||
<label>Input Label</label>
|
||||
<input type="text" placeholder="large-4.cell" />
|
||||
</div>
|
||||
<div class="large-4 medium-4 cell">
|
||||
<div class="grid-x">
|
||||
<label>Input Label</label>
|
||||
<div class="input-group">
|
||||
<input type="text" placeholder="small-9.cell" class="input-group-field" />
|
||||
<span class="input-group-label">.com</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-12 cell">
|
||||
<label>Select Box</label>
|
||||
<select>
|
||||
<option value="husker">Husker</option>
|
||||
<option value="starbuck">Starbuck</option>
|
||||
<option value="hotdog">Hot Dog</option>
|
||||
<option value="apollo">Apollo</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-6 medium-6 cell">
|
||||
<label>Choose Your Favorite</label>
|
||||
<input type="radio" name="pokemon" value="Red" id="pokemonRed"><label for="pokemonRed">Radio 1</label>
|
||||
<input type="radio" name="pokemon" value="Blue" id="pokemonBlue"><label for="pokemonBlue">Radio 2</label>
|
||||
</div>
|
||||
<div class="large-6 medium-6 cell">
|
||||
<label>Check these out</label>
|
||||
<input id="checkbox1" type="checkbox"><label for="checkbox1">Checkbox 1</label>
|
||||
<input id="checkbox2" type="checkbox"><label for="checkbox2">Checkbox 2</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-12 cell">
|
||||
<label>Textarea Label</label>
|
||||
<textarea placeholder="small-12.cell"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="large-4 medium-4 cell">
|
||||
<h5>Try one of these buttons:</h5>
|
||||
<p><a href="#" class="button">Simple Button</a><br/>
|
||||
<a href="#" class="success button">Success Btn</a><br/>
|
||||
<a href="#" class="alert button">Alert Btn</a><br/>
|
||||
<a href="#" class="secondary button">Secondary Btn</a></p>
|
||||
<div class="callout">
|
||||
<h5>So many components, girl!</h5>
|
||||
<p>A whole kitchen sink of goodies comes with Foundation. Check out the docs to see them all, along with details on making them your own.</p>
|
||||
<a href="http://foundation.zurb.com/sites/docs/" class="small button">Go to Foundation Docs</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/vendor/jquery.js"></script>
|
||||
<script src="js/vendor/what-input.js"></script>
|
||||
<script src="js/vendor/foundation.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,4 @@
|
|||
module.exports = {
|
||||
sass: require('./sass'),
|
||||
js: require('./js')
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
var empty = require('is-empty-object');
|
||||
var unique = require('array-uniq');
|
||||
var path = require('path');
|
||||
|
||||
// custom module names where needed
|
||||
const MODULES = {
|
||||
'offcanvas': 'OffCanvas'
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates an array of file paths that can be passed to `gulp.src()`.
|
||||
* @param {Object} config - Customizer configuration file.
|
||||
* @param {String[]} modules - Modules to include in the file list.
|
||||
* @returns {String[]} Array of file paths.
|
||||
*/
|
||||
|
||||
module.exports = function(config, modules) {
|
||||
var dir = path.resolve(__dirname, '../../js/');
|
||||
var entry = "import $ from 'jquery';\n" +
|
||||
"import { Foundation } from '" + dir + "/foundation.core';\n" +
|
||||
"Foundation.addToJquery($);\n" +
|
||||
"import { MediaQuery } from '" + dir + "/foundation.util.mediaQuery';\n" +
|
||||
"Foundation.MediaQuery = MediaQuery;\n" +
|
||||
"import { Triggers } from '" + dir + "/foundation.util.triggers';\n" +
|
||||
"Triggers.init($, Foundation);\n";
|
||||
|
||||
// last 2 pieces work around https://github.com/zurb/foundation-sites/issues/10287
|
||||
|
||||
var libraries = [];
|
||||
|
||||
if (empty(modules)) {
|
||||
modules = Object.keys(config);
|
||||
}
|
||||
|
||||
for (var i in modules) {
|
||||
var name = modules[i];
|
||||
|
||||
// Check if the module has JS files
|
||||
if (config[name] && config[name].js) {
|
||||
libraries.push(config[name].js);
|
||||
}
|
||||
}
|
||||
|
||||
// add plugins into entry
|
||||
for (var i in libraries) {
|
||||
var file = libraries[i];
|
||||
var moduleName = MODULES[file] || file.charAt(0).toUpperCase() + file.slice(1);
|
||||
entry = entry + "import { " + moduleName + " } from '" + dir + "/foundation." + file + "';\n";
|
||||
entry = entry + "Foundation.plugin(" + moduleName + ", '" + moduleName + "');\n";
|
||||
}
|
||||
|
||||
// return entry file as string
|
||||
return entry;
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
var empty = require('is-empty-object');
|
||||
var format = require('util').format;
|
||||
var multiline = require('multiline').stripIndent;
|
||||
|
||||
var SASS_TEMPLATE = multiline(function() {/*
|
||||
@charset 'utf-8';
|
||||
|
||||
// Variables go here
|
||||
%s
|
||||
|
||||
// Core imports go here
|
||||
@import 'foundation';
|
||||
@import 'motion-ui';
|
||||
|
||||
// Modules go here
|
||||
%s
|
||||
|
||||
// Motion UI goes here
|
||||
@include motion-ui-transitions;
|
||||
@include motion-ui-animations;
|
||||
*/});
|
||||
|
||||
/**
|
||||
* Generates an entry point Sass file with a custom list of CSS exports and Sass variables.
|
||||
* @param {Object} config - Customizer configuration object.
|
||||
* @param {String[]} modules - Modules to include CSS for.
|
||||
* @param {Object} variables - Sass variable overrides to include. The key is the name of the variable, and the value is the value.
|
||||
* @returns {String} Formatted Sass file.
|
||||
*/
|
||||
module.exports = function(config, modules, variables) {
|
||||
var variableList = [];
|
||||
var colorList = {};
|
||||
var exportList = ['@include foundation-global-styles;'];
|
||||
|
||||
if (empty(modules)) {
|
||||
modules = Object.keys(config);
|
||||
}
|
||||
|
||||
// Create variable overrides code
|
||||
for (var i in variables) {
|
||||
var name = i.replace('_', '-');
|
||||
if (name.match(/-color$/)) {
|
||||
var key = name.replace('-color', '');
|
||||
colorList[key] = variables[i];
|
||||
}
|
||||
else {
|
||||
variableList.push(format('$%s: %s;', name, variables[i]));
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty(colorList)) {
|
||||
variableList.push(createPaletteMap(colorList));
|
||||
}
|
||||
|
||||
// Create module exports with @include
|
||||
for (var i in modules) {
|
||||
var name = modules[i];
|
||||
|
||||
if (config[name] && config[name].sass) {
|
||||
exportList.push(format('@include foundation-%s;', config[name].sass));
|
||||
}
|
||||
}
|
||||
|
||||
return format(SASS_TEMPLATE, variableList.join('\n'), exportList.join('\n'))
|
||||
}
|
||||
|
||||
function createPaletteMap(colors) {
|
||||
var output = '$foundation-palette: (%s\n);';
|
||||
var keys = '';
|
||||
|
||||
for (var i in colors) {
|
||||
keys += format('\n %s: %s,', i, colors[i]);
|
||||
}
|
||||
|
||||
return format(output, keys);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,496 @@
|
|||
// Type definitions for Foundation Sites v6.3.1
|
||||
// Project: http://foundation.zurb.com/
|
||||
// Github: https://github.com/zurb/foundation-sites
|
||||
//
|
||||
// Definitions by: Sam Vloeberghs <https://github.com/samvloeberghs/>
|
||||
// Original Definitions: https://github.com/samvloeberghs/foundation-sites-typings
|
||||
|
||||
declare module FoundationSites {
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/abide.html#javascript-reference
|
||||
interface Abide {
|
||||
requiredChecked(element: JQuery): boolean;
|
||||
findFormError(element: JQuery): JQuery;
|
||||
findLabel(element: JQuery): boolean;
|
||||
addErrorClasses(element: JQuery): void;
|
||||
removeRadioErrorClasses(groupName: string): void;
|
||||
removeErrorClasses(element: JQuery): void;
|
||||
validateInput(element: JQuery): boolean;
|
||||
validateForm(): boolean;
|
||||
validateText(element: JQuery, pattern: string): boolean;
|
||||
validateRadio(groupName: string): boolean;
|
||||
matchValidation(element: JQuery, validators: string, required: boolean): boolean;
|
||||
resetForm(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface AbideDefaults {
|
||||
validateOn: string;
|
||||
labelErrorClass: string;
|
||||
inputErrorClass: string;
|
||||
formErrorSelector: string;
|
||||
formErrorClass: string;
|
||||
liveValidate: boolean;
|
||||
validateOnBlur: boolean;
|
||||
patterns: IAbidePatterns;
|
||||
validators: any; // TODO, maybe there is a better solution to describe how this object may look like
|
||||
}
|
||||
|
||||
interface IAbidePatterns {
|
||||
alpha?: RegExp;
|
||||
alpha_numeric?: RegExp;
|
||||
integer?: RegExp;
|
||||
number?: RegExp;
|
||||
card?: RegExp;
|
||||
cvv?: RegExp;
|
||||
email ?: RegExp;
|
||||
url?: RegExp;
|
||||
domain?: RegExp;
|
||||
datetime?: RegExp;
|
||||
date?: RegExp;
|
||||
time?: RegExp;
|
||||
dateISO?: RegExp;
|
||||
month_day_year?: RegExp;
|
||||
day_month_year?: RegExp;
|
||||
color?: RegExp;
|
||||
}
|
||||
|
||||
interface IAbideOptions {
|
||||
validateOn?: string;
|
||||
labelErrorClass?: string;
|
||||
inputErrorClass?: string;
|
||||
formErrorSelector?: string;
|
||||
formErrorClass?: string;
|
||||
liveValidate?: boolean;
|
||||
validators?: any;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/accordion.html#javascript-reference
|
||||
interface Accordion {
|
||||
toggle($target: JQuery): void;
|
||||
down($target: JQuery, firstTime: boolean): void;
|
||||
up($target: JQuery): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IAccordionOptions {
|
||||
slideSpeed?: number
|
||||
multiExpand?: boolean;
|
||||
allowAllClosed?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/accordion-menu.html#javascript-reference
|
||||
interface AccordionMenu {
|
||||
hideAll(): void;
|
||||
toggle($target: JQuery): void;
|
||||
down($target: JQuery, firstTime: boolean): void;
|
||||
up($target: JQuery): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IAccordionMenuOptions {
|
||||
slideSpeed?: number;
|
||||
multiOpen?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/drilldown-menu.html#javascript-reference
|
||||
interface Drilldown {
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IDrilldownOptions {
|
||||
backButton?: string;
|
||||
wrapper?: string;
|
||||
parentLink?: boolean;
|
||||
closeOnClick?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/dropdown.html#javascript-reference
|
||||
interface Dropdown {
|
||||
getPositionClass(): string;
|
||||
open(): void;
|
||||
close(): void;
|
||||
toggle(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IDropdownOptions {
|
||||
hoverDelay?: number;
|
||||
hover?: boolean;
|
||||
hoverPane?: boolean;
|
||||
vOffset?: number;
|
||||
hOffset?: number;
|
||||
positionClass?: string;
|
||||
trapFocus?: boolean;
|
||||
autoFocus?: boolean;
|
||||
closeOnClick?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/dropdown-menu.html#javascript-reference
|
||||
interface DropdownMenu {
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IDropdownMenuOptions {
|
||||
disableHover?: boolean;
|
||||
autoclose?: boolean;
|
||||
hoverDelay?: number;
|
||||
clickOpen?: boolean;
|
||||
closingTime?: number;
|
||||
alignment?: string;
|
||||
closeOnClick?: boolean;
|
||||
verticalClass?: string;
|
||||
rightClass?: string;
|
||||
forceFollow?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference
|
||||
interface Equalizer {
|
||||
getHeights(cb: Function): Array<any>;
|
||||
getHeightsByRow(cb: Function): Array<any>;
|
||||
applyHeight(heights: Array<any>): void;
|
||||
applyHeightByRow(groups: Array<any>): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IEqualizerOptions {
|
||||
equalizeOnStack?: boolean;
|
||||
equalizeByRow?: boolean;
|
||||
equalizeOn?: string;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/interchange.html#javascript-reference
|
||||
interface Interchange {
|
||||
replace(path: string): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IInterchangeOptions {
|
||||
rules?: Array<any>
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/magellan.html#javascript-reference
|
||||
interface Magellan {
|
||||
calcPoints(): void;
|
||||
scrollToLoc(location: string): void;
|
||||
reflow(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IMagellanOptions {
|
||||
animationDuration?: number;
|
||||
animationEasing?: string;
|
||||
threshold?: number;
|
||||
activeClass?: string;
|
||||
deepLinking?: boolean;
|
||||
barOffset?: number;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/offcanvas.html#javascript-reference
|
||||
interface OffCanvas {
|
||||
reveal(isRevealed: boolean): void;
|
||||
open(event: Event, trigger: JQuery): void;
|
||||
close(cb?: Function): void;
|
||||
toggle(event: Event, trigger: JQuery): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IOffCanvasOptions {
|
||||
closeOnClick?: boolean;
|
||||
transitionTime?: number;
|
||||
position?: string;
|
||||
forceTop?: boolean;
|
||||
isRevealed?: boolean;
|
||||
revealOn?: string;
|
||||
autoFocus?: boolean;
|
||||
revealClass?: string;
|
||||
trapFocus?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/orbit.html#javascript-reference
|
||||
interface Orbit {
|
||||
geoSync(): void;
|
||||
changeSlide(isLTR: boolean, chosenSlide?: JQuery, idx?: number): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IOrbitOptions {
|
||||
bullets?: boolean;
|
||||
navButtons?: boolean;
|
||||
animInFromRight?: string;
|
||||
animOutToRight?: string;
|
||||
animInFromLeft?: string;
|
||||
animOutToLeft?: string;
|
||||
autoPlay?: boolean;
|
||||
timerDelay?: number;
|
||||
infiniteWrap?: boolean;
|
||||
swipe?: boolean;
|
||||
pauseOnHover?: boolean;
|
||||
accessible?: boolean;
|
||||
containerClass?: string;
|
||||
slideClass?: string;
|
||||
boxOfBullets?: string;
|
||||
nextClass?: string;
|
||||
prevClass?: string;
|
||||
useMUI?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/reveal.html#javascript-reference
|
||||
interface Reveal {
|
||||
open(): void;
|
||||
toggle(): void;
|
||||
close(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IRevealOptions {
|
||||
animationIn?: string;
|
||||
animationOut?: string;
|
||||
showDelay?: number;
|
||||
hideDelay?: number;
|
||||
closeOnClick?: boolean;
|
||||
closeOnEsc?: boolean;
|
||||
multipleOpened?: boolean;
|
||||
vOffset?: number;
|
||||
hOffset?: number;
|
||||
fullScreen?: boolean;
|
||||
btmOffsetPct?: number;
|
||||
overlay?: boolean;
|
||||
resetOnClose?: boolean;
|
||||
deepLink?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/slider.html#javascript-reference
|
||||
interface Slider {
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface ISliderOptions {
|
||||
start?: number;
|
||||
end?: number;
|
||||
step?: number;
|
||||
initialStart ?: number;
|
||||
initialEnd?: number;
|
||||
binding?: boolean;
|
||||
clickSelect?: boolean;
|
||||
vertical?: boolean;
|
||||
draggable?: boolean;
|
||||
disabled?: boolean;
|
||||
doubleSided?: boolean;
|
||||
decimal?: number;
|
||||
moveTime?: number;
|
||||
disabledClass?: string;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/sticky.html#javascript-reference
|
||||
interface Sticky {
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface IStickyOptions {
|
||||
container?: string;
|
||||
stickTo?: string;
|
||||
anchor?: string;
|
||||
topAnchor?: string;
|
||||
btmAnchor?: string;
|
||||
marginTop?: number;
|
||||
marginBottom?: number;
|
||||
stickyOn?: string;
|
||||
stickyClass?: string;
|
||||
containerClass?: string;
|
||||
checkEvery?: number;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/tabs.html#javascript-reference
|
||||
interface Tabs {
|
||||
selectTab(element: JQuery | string): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface ITabsOptions {
|
||||
autoFocus?: boolean;
|
||||
wrapOnKeys?: boolean;
|
||||
matchHeight?: boolean;
|
||||
linkClass?: string;
|
||||
panelClass?: string;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/toggler.html#javascript-reference
|
||||
interface Toggler {
|
||||
toggle(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface ITogglerOptions {
|
||||
animate?: boolean;
|
||||
}
|
||||
|
||||
// http://foundation.zurb.com/sites/docs/tooltip.html#javascript-reference
|
||||
interface Tooltip {
|
||||
show(): void;
|
||||
hide(): void;
|
||||
toggle(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface ITooltipOptions {
|
||||
hoverDelay?: number;
|
||||
fadeInDuration?: number;
|
||||
fadeOutDuration?: number;
|
||||
disableHover?: boolean;
|
||||
templateClasses?: string;
|
||||
tooltipClass?: string;
|
||||
triggerClass?: string;
|
||||
showOn?: string;
|
||||
template?: string;
|
||||
tipText?: string;
|
||||
clickOpen?: boolean;
|
||||
positionClass?: string;
|
||||
vOffset?: number;
|
||||
hOffset?: number;
|
||||
}
|
||||
|
||||
// Utilities
|
||||
// ---------
|
||||
|
||||
interface Box {
|
||||
ImNotTouchingYou(element: Object, parent?: Object, lrOnly?: boolean, tbOnly?: boolean): boolean;
|
||||
GetDimensions(element: Object): Object;
|
||||
GetOffsets(element: Object, anchor: Object, position: string, vOffset: number, hOffset: number, isOverflow: boolean): Object;
|
||||
}
|
||||
|
||||
interface Keyboard {
|
||||
parseKey(event: any): string;
|
||||
handleKey(event: any, component: any, functions: any): void;
|
||||
findFocusable($element: Object): Object;
|
||||
}
|
||||
|
||||
interface MediaQuery {
|
||||
get(size: string): string;
|
||||
atLeast(size: string): boolean;
|
||||
queries: Array<string>;
|
||||
current: string;
|
||||
}
|
||||
|
||||
interface Motion {
|
||||
animateIn(element: Object, animation: any, cb: Function): void;
|
||||
animateOut(element: Object, animation: any, cb: Function): void;
|
||||
}
|
||||
|
||||
interface Move {
|
||||
// TODO
|
||||
}
|
||||
|
||||
interface Nest {
|
||||
Feather(menu: any, type: any): void;
|
||||
Burn(menu: any, type: any): void;
|
||||
}
|
||||
|
||||
interface Timer {
|
||||
start(): void;
|
||||
restart(): void;
|
||||
pause(): void;
|
||||
}
|
||||
|
||||
interface Touch {
|
||||
// TODO :extension on jQuery
|
||||
}
|
||||
|
||||
interface Triggers {
|
||||
// TODO :extension on jQuery
|
||||
}
|
||||
|
||||
interface FoundationSitesStatic {
|
||||
version: string;
|
||||
|
||||
rtl(): boolean;
|
||||
plugin(plugin: Object, name: string): void;
|
||||
registerPlugin(plugin: Object): void;
|
||||
unregisterPlugin(plugin: Object): void;
|
||||
reInit(plugins: Array<any>): void;
|
||||
GetYoDigits(length: number, namespace?: string): string;
|
||||
reflow(elem: Object, plugins?: Array<string>|string): void;
|
||||
getFnName(fn: string): string;
|
||||
transitionend(): string;
|
||||
|
||||
util: {
|
||||
throttle(func: (...args: any[]) => any, delay: number): (...args: any[]) => any;
|
||||
};
|
||||
|
||||
Abide: {
|
||||
new(element: JQuery, options?: IAbideOptions): Abide;
|
||||
defaults: AbideDefaults;
|
||||
}
|
||||
Accordion: {
|
||||
new(element: JQuery, options?: IAccordionOptions): Accordion;
|
||||
}
|
||||
AccordionMenu: {
|
||||
new(element: JQuery, options?: IAccordionMenuOptions): AccordionMenu;
|
||||
}
|
||||
Drilldown: {
|
||||
new(element: JQuery, options?: IDrilldownOptions): Drilldown;
|
||||
}
|
||||
Dropdown: {
|
||||
new(element: JQuery, options?: IDropdownOptions): Dropdown;
|
||||
}
|
||||
DropdownMenu: {
|
||||
new(element: JQuery, options?: IDropdownMenuOptions): DropdownMenu;
|
||||
}
|
||||
Equalizer: {
|
||||
new(element: JQuery, options?: IEqualizerOptions): Equalizer;
|
||||
}
|
||||
Interchange: {
|
||||
new(element: JQuery, options?: IInterchangeOptions): Interchange;
|
||||
}
|
||||
Magellan: {
|
||||
new(element: JQuery, options?: IMagellanOptions): Magellan;
|
||||
}
|
||||
OffCanvas: {
|
||||
new(element: JQuery, options?: IOffCanvasOptions): OffCanvas;
|
||||
}
|
||||
Orbit: {
|
||||
new(element: JQuery, options?: IOrbitOptions): Orbit;
|
||||
}
|
||||
Reveal: {
|
||||
new(element: JQuery, options?: IRevealOptions): Reveal;
|
||||
};
|
||||
Slider: {
|
||||
new(element: JQuery, options?: ISliderOptions): Slider;
|
||||
}
|
||||
Sticky: {
|
||||
new(element: JQuery, options?: IStickyOptions): Sticky;
|
||||
}
|
||||
Tabs: {
|
||||
new(element: JQuery, options?: ITabsOptions): Tabs;
|
||||
}
|
||||
Toggler: {
|
||||
new(element: JQuery, options?: ITogglerOptions): Toggler;
|
||||
}
|
||||
Tooltip: {
|
||||
new(element: JQuery, options?: ITooltipOptions): Tooltip;
|
||||
}
|
||||
|
||||
// utils
|
||||
Box: Box;
|
||||
Keyboard: Keyboard;
|
||||
MediaQuery: MediaQuery;
|
||||
Motion: Motion;
|
||||
Move: Move;
|
||||
Nest: Nest;
|
||||
Timer: Timer;
|
||||
Touch: Touch;
|
||||
Triggers: Triggers;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
foundation(method?: string|Array<any>, $element?: JQuery): JQuery;
|
||||
}
|
||||
|
||||
declare var Foundation: FoundationSites.FoundationSitesStatic;
|
||||
|
||||
declare module "Foundation" {
|
||||
export = Foundation;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,104 @@
|
|||
import $ from 'jquery';
|
||||
|
||||
import { Foundation } from '../../js/foundation.core';
|
||||
Foundation.addToJquery($);
|
||||
|
||||
// Add Foundation Utils to Foundation global namespace for backwards
|
||||
// compatibility.
|
||||
|
||||
import { rtl, GetYoDigits, transitionend, RegExpEscape } from '../../js/foundation.util.core';
|
||||
Foundation.rtl = rtl;
|
||||
Foundation.GetYoDigits = GetYoDigits;
|
||||
Foundation.transitionend = transitionend;
|
||||
Foundation.RegExpEscape = RegExpEscape;
|
||||
|
||||
import { Box } from '../../js/foundation.util.box'
|
||||
import { onImagesLoaded } from '../../js/foundation.util.imageLoader';
|
||||
import { Keyboard } from '../../js/foundation.util.keyboard';
|
||||
import { MediaQuery } from '../../js/foundation.util.mediaQuery';
|
||||
import { Motion, Move } from '../../js/foundation.util.motion';
|
||||
import { Nest } from '../../js/foundation.util.nest';
|
||||
import { Timer } from '../../js/foundation.util.timer';
|
||||
|
||||
Foundation.Box = Box;
|
||||
Foundation.onImagesLoaded = onImagesLoaded;
|
||||
Foundation.Keyboard = Keyboard;
|
||||
Foundation.MediaQuery = MediaQuery;
|
||||
Foundation.Motion = Motion;
|
||||
Foundation.Move = Move;
|
||||
Foundation.Nest = Nest;
|
||||
Foundation.Timer = Timer;
|
||||
|
||||
// Touch and Triggers previously were almost purely sede effect driven,
|
||||
// so n../../js// need to add it to Foundation, just init them.
|
||||
|
||||
import { Touch } from '../../js/foundation.util.touch';
|
||||
Touch.init($);
|
||||
|
||||
import { Triggers } from '../../js/foundation.util.triggers';
|
||||
Triggers.init($, Foundation);
|
||||
|
||||
import { Abide } from '../../js/foundation.abide';
|
||||
Foundation.plugin(Abide, 'Abide');
|
||||
|
||||
import { Accordion } from '../../js/foundation.accordion';
|
||||
Foundation.plugin(Accordion, 'Accordion');
|
||||
|
||||
import { AccordionMenu } from '../../js/foundation.accordionMenu';
|
||||
Foundation.plugin(AccordionMenu, 'AccordionMenu');
|
||||
|
||||
import { Drilldown } from '../../js/foundation.drilldown';
|
||||
Foundation.plugin(Drilldown, 'Drilldown');
|
||||
|
||||
import { Dropdown } from '../../js/foundation.dropdown';
|
||||
Foundation.plugin(Dropdown, 'Dropdown');
|
||||
|
||||
import { DropdownMenu } from '../../js/foundation.dropdownMenu';
|
||||
Foundation.plugin(DropdownMenu, 'DropdownMenu');
|
||||
|
||||
import { Equalizer } from '../../js/foundation.equalizer';
|
||||
Foundation.plugin(Equalizer, 'Equalizer');
|
||||
|
||||
import { Interchange } from '../../js/foundation.interchange';
|
||||
Foundation.plugin(Interchange, 'Interchange');
|
||||
|
||||
import { Magellan } from '../../js/foundation.magellan';
|
||||
Foundation.plugin(Magellan, 'Magellan');
|
||||
|
||||
import { OffCanvas } from '../../js/foundation.offcanvas';
|
||||
Foundation.plugin(OffCanvas, 'OffCanvas');
|
||||
|
||||
import { Orbit } from '../../js/foundation.orbit';
|
||||
Foundation.plugin(Orbit, 'Orbit');
|
||||
|
||||
import { ResponsiveMenu } from '../../js/foundation.responsiveMenu';
|
||||
Foundation.plugin(ResponsiveMenu, 'ResponsiveMenu');
|
||||
|
||||
import { ResponsiveToggle } from '../../js/foundation.responsiveToggle';
|
||||
Foundation.plugin(ResponsiveToggle, 'ResponsiveToggle');
|
||||
|
||||
import { Reveal } from '../../js/foundation.reveal';
|
||||
Foundation.plugin(Reveal, 'Reveal');
|
||||
|
||||
import { Slider } from '../../js/foundation.slider';
|
||||
Foundation.plugin(Slider, 'Slider');
|
||||
|
||||
import { SmoothScroll } from '../../js/foundation.smoothScroll';
|
||||
Foundation.plugin(SmoothScroll, 'SmoothScroll');
|
||||
|
||||
import { Sticky } from '../../js/foundation.sticky';
|
||||
Foundation.plugin(Sticky, 'Sticky');
|
||||
|
||||
import { Tabs } from '../../js/foundation.tabs';
|
||||
Foundation.plugin(Tabs, 'Tabs');
|
||||
|
||||
import { Toggler } from '../../js/foundation.toggler';
|
||||
Foundation.plugin(Toggler, 'Toggler');
|
||||
|
||||
import { Tooltip } from '../../js/foundation.tooltip';
|
||||
Foundation.plugin(Tooltip, 'Tooltip');
|
||||
|
||||
import { ResponsiveAccordionTabs } from '../../js/foundation.responsiveAccordionTabs';
|
||||
Foundation.plugin(ResponsiveAccordionTabs, 'ResponsiveAccordionTabs');
|
||||
|
||||
export default Foundation;
|
|
@ -0,0 +1,781 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 79);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 13:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_abide__ = __webpack_require__(43);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_abide__["a" /* Abide */], 'Abide');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 43:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Abide; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Abide module.
|
||||
* @module foundation.abide
|
||||
*/
|
||||
|
||||
var Abide = function (_Plugin) {
|
||||
_inherits(Abide, _Plugin);
|
||||
|
||||
function Abide() {
|
||||
_classCallCheck(this, Abide);
|
||||
|
||||
return _possibleConstructorReturn(this, (Abide.__proto__ || Object.getPrototypeOf(Abide)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Abide, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of Abide.
|
||||
* @class
|
||||
* @name Abide
|
||||
* @fires Abide#init
|
||||
* @param {Object} element - jQuery object to add the trigger to.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(true, {}, Abide.defaults, this.$element.data(), options);
|
||||
|
||||
this.className = 'Abide'; // ie9 back compat
|
||||
this._init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Abide plugin and calls functions to get Abide functioning on load.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
this.$inputs = this.$element.find('input, textarea, select');
|
||||
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes events for Abide.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this3 = this;
|
||||
|
||||
this.$element.off('.abide').on('reset.zf.abide', function () {
|
||||
_this3.resetForm();
|
||||
}).on('submit.zf.abide', function () {
|
||||
return _this3.validateForm();
|
||||
});
|
||||
|
||||
if (this.options.validateOn === 'fieldChange') {
|
||||
this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) {
|
||||
_this3.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target));
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.liveValidate) {
|
||||
this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) {
|
||||
_this3.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target));
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.validateOnBlur) {
|
||||
this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) {
|
||||
_this3.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls necessary functions to update Abide upon DOM change
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_reflow',
|
||||
value: function _reflow() {
|
||||
this._init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not a form element has the required attribute and if it's checked or not
|
||||
* @param {Object} element - jQuery object to check for required attribute
|
||||
* @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'requiredCheck',
|
||||
value: function requiredCheck($el) {
|
||||
if (!$el.attr('required')) return true;
|
||||
|
||||
var isGood = true;
|
||||
|
||||
switch ($el[0].type) {
|
||||
case 'checkbox':
|
||||
isGood = $el[0].checked;
|
||||
break;
|
||||
|
||||
case 'select':
|
||||
case 'select-one':
|
||||
case 'select-multiple':
|
||||
var opt = $el.find('option:selected');
|
||||
if (!opt.length || !opt.val()) isGood = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!$el.val() || !$el.val().length) isGood = false;
|
||||
}
|
||||
|
||||
return isGood;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get:
|
||||
* - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:
|
||||
* 1. The element's direct sibling('s).
|
||||
* 2. The element's parent's children.
|
||||
* - Element(s) with the attribute `[data-form-error-for]` set with the element's id.
|
||||
*
|
||||
* This allows for multiple form errors per input, though if none are found, no form errors will be shown.
|
||||
*
|
||||
* @param {Object} $el - jQuery object to use as reference to find the form error selector.
|
||||
* @returns {Object} jQuery object with the selector.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'findFormError',
|
||||
value: function findFormError($el) {
|
||||
var id = $el[0].id;
|
||||
var $error = $el.siblings(this.options.formErrorSelector);
|
||||
|
||||
if (!$error.length) {
|
||||
$error = $el.parent().find(this.options.formErrorSelector);
|
||||
}
|
||||
|
||||
$error = $error.add(this.$element.find('[data-form-error-for="' + id + '"]'));
|
||||
|
||||
return $error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first element in this order:
|
||||
* 2. The <label> with the attribute `[for="someInputId"]`
|
||||
* 3. The `.closest()` <label>
|
||||
*
|
||||
* @param {Object} $el - jQuery object to check for required attribute
|
||||
* @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'findLabel',
|
||||
value: function findLabel($el) {
|
||||
var id = $el[0].id;
|
||||
var $label = this.$element.find('label[for="' + id + '"]');
|
||||
|
||||
if (!$label.length) {
|
||||
return $el.closest('label');
|
||||
}
|
||||
|
||||
return $label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the set of labels associated with a set of radio els in this order
|
||||
* 2. The <label> with the attribute `[for="someInputId"]`
|
||||
* 3. The `.closest()` <label>
|
||||
*
|
||||
* @param {Object} $el - jQuery object to check for required attribute
|
||||
* @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'findRadioLabels',
|
||||
value: function findRadioLabels($els) {
|
||||
var _this4 = this;
|
||||
|
||||
var labels = $els.map(function (i, el) {
|
||||
var id = el.id;
|
||||
var $label = _this4.$element.find('label[for="' + id + '"]');
|
||||
|
||||
if (!$label.length) {
|
||||
$label = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el).closest('label');
|
||||
}
|
||||
return $label[0];
|
||||
});
|
||||
|
||||
return __WEBPACK_IMPORTED_MODULE_0_jquery___default()(labels);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the CSS error class as specified by the Abide settings to the label, input, and the form
|
||||
* @param {Object} $el - jQuery object to add the class to
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'addErrorClasses',
|
||||
value: function addErrorClasses($el) {
|
||||
var $label = this.findLabel($el);
|
||||
var $formError = this.findFormError($el);
|
||||
|
||||
if ($label.length) {
|
||||
$label.addClass(this.options.labelErrorClass);
|
||||
}
|
||||
|
||||
if ($formError.length) {
|
||||
$formError.addClass(this.options.formErrorClass);
|
||||
}
|
||||
|
||||
$el.addClass(this.options.inputErrorClass).attr('data-invalid', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove CSS error classes etc from an entire radio button group
|
||||
* @param {String} groupName - A string that specifies the name of a radio button group
|
||||
*
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'removeRadioErrorClasses',
|
||||
value: function removeRadioErrorClasses(groupName) {
|
||||
var $els = this.$element.find(':radio[name="' + groupName + '"]');
|
||||
var $labels = this.findRadioLabels($els);
|
||||
var $formErrors = this.findFormError($els);
|
||||
|
||||
if ($labels.length) {
|
||||
$labels.removeClass(this.options.labelErrorClass);
|
||||
}
|
||||
|
||||
if ($formErrors.length) {
|
||||
$formErrors.removeClass(this.options.formErrorClass);
|
||||
}
|
||||
|
||||
$els.removeClass(this.options.inputErrorClass).removeAttr('data-invalid');
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes CSS error class as specified by the Abide settings from the label, input, and the form
|
||||
* @param {Object} $el - jQuery object to remove the class from
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'removeErrorClasses',
|
||||
value: function removeErrorClasses($el) {
|
||||
// radios need to clear all of the els
|
||||
if ($el[0].type == 'radio') {
|
||||
return this.removeRadioErrorClasses($el.attr('name'));
|
||||
}
|
||||
|
||||
var $label = this.findLabel($el);
|
||||
var $formError = this.findFormError($el);
|
||||
|
||||
if ($label.length) {
|
||||
$label.removeClass(this.options.labelErrorClass);
|
||||
}
|
||||
|
||||
if ($formError.length) {
|
||||
$formError.removeClass(this.options.formErrorClass);
|
||||
}
|
||||
|
||||
$el.removeClass(this.options.inputErrorClass).removeAttr('data-invalid');
|
||||
}
|
||||
|
||||
/**
|
||||
* Goes through a form to find inputs and proceeds to validate them in ways specific to their type.
|
||||
* Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set
|
||||
* @fires Abide#invalid
|
||||
* @fires Abide#valid
|
||||
* @param {Object} element - jQuery object to validate, should be an HTML input
|
||||
* @returns {Boolean} goodToGo - If the input is valid or not.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'validateInput',
|
||||
value: function validateInput($el) {
|
||||
var clearRequire = this.requiredCheck($el),
|
||||
validated = false,
|
||||
customValidator = true,
|
||||
validator = $el.attr('data-validator'),
|
||||
equalTo = true;
|
||||
|
||||
// don't validate ignored inputs or hidden inputs or disabled inputs
|
||||
if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch ($el[0].type) {
|
||||
case 'radio':
|
||||
validated = this.validateRadio($el.attr('name'));
|
||||
break;
|
||||
|
||||
case 'checkbox':
|
||||
validated = clearRequire;
|
||||
break;
|
||||
|
||||
case 'select':
|
||||
case 'select-one':
|
||||
case 'select-multiple':
|
||||
validated = clearRequire;
|
||||
break;
|
||||
|
||||
default:
|
||||
validated = this.validateText($el);
|
||||
}
|
||||
|
||||
if (validator) {
|
||||
customValidator = this.matchValidation($el, validator, $el.attr('required'));
|
||||
}
|
||||
|
||||
if ($el.attr('data-equalto')) {
|
||||
equalTo = this.options.validators.equalTo($el);
|
||||
}
|
||||
|
||||
var goodToGo = [clearRequire, validated, customValidator, equalTo].indexOf(false) === -1;
|
||||
var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide';
|
||||
|
||||
if (goodToGo) {
|
||||
// Re-validate inputs that depend on this one with equalto
|
||||
var dependentElements = this.$element.find('[data-equalto="' + $el.attr('id') + '"]');
|
||||
if (dependentElements.length) {
|
||||
var _this = this;
|
||||
dependentElements.each(function () {
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).val()) {
|
||||
_this.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this[goodToGo ? 'removeErrorClasses' : 'addErrorClasses']($el);
|
||||
|
||||
/**
|
||||
* Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide`
|
||||
* Trigger includes the DOM element of the input.
|
||||
* @event Abide#valid
|
||||
* @event Abide#invalid
|
||||
*/
|
||||
$el.trigger(message, [$el]);
|
||||
|
||||
return goodToGo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Goes through a form and if there are any invalid inputs, it will display the form error element
|
||||
* @returns {Boolean} noError - true if no errors were detected...
|
||||
* @fires Abide#formvalid
|
||||
* @fires Abide#forminvalid
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'validateForm',
|
||||
value: function validateForm() {
|
||||
var acc = [];
|
||||
var _this = this;
|
||||
|
||||
this.$inputs.each(function () {
|
||||
acc.push(_this.validateInput(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)));
|
||||
});
|
||||
|
||||
var noError = acc.indexOf(false) === -1;
|
||||
|
||||
this.$element.find('[data-abide-error]').css('display', noError ? 'none' : 'block');
|
||||
|
||||
/**
|
||||
* Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`.
|
||||
* Trigger includes the element of the form.
|
||||
* @event Abide#formvalid
|
||||
* @event Abide#forminvalid
|
||||
*/
|
||||
this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]);
|
||||
|
||||
return noError;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or a not a text input is valid based on the pattern specified in the attribute. If no matching pattern is found, returns true.
|
||||
* @param {Object} $el - jQuery object to validate, should be a text input HTML element
|
||||
* @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns
|
||||
* @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'validateText',
|
||||
value: function validateText($el, pattern) {
|
||||
// A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute
|
||||
pattern = pattern || $el.attr('pattern') || $el.attr('type');
|
||||
var inputText = $el.val();
|
||||
var valid = false;
|
||||
|
||||
if (inputText.length) {
|
||||
// If the pattern attribute on the element is in Abide's list of patterns, then test that regexp
|
||||
if (this.options.patterns.hasOwnProperty(pattern)) {
|
||||
valid = this.options.patterns[pattern].test(inputText);
|
||||
}
|
||||
// If the pattern name isn't also the type attribute of the field, then test it as a regexp
|
||||
else if (pattern !== $el.attr('type')) {
|
||||
valid = new RegExp(pattern).test(inputText);
|
||||
} else {
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
// An empty field is valid if it's not required
|
||||
else if (!$el.prop('required')) {
|
||||
valid = true;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or a not a radio input is valid based on whether or not it is required and selected. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all radio buttons in its group.
|
||||
* @param {String} groupName - A string that specifies the name of a radio button group
|
||||
* @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required)
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'validateRadio',
|
||||
value: function validateRadio(groupName) {
|
||||
// If at least one radio in the group has the `required` attribute, the group is considered required
|
||||
// Per W3C spec, all radio buttons in a group should have `required`, but we're being nice
|
||||
var $group = this.$element.find(':radio[name="' + groupName + '"]');
|
||||
var valid = false,
|
||||
required = false;
|
||||
|
||||
// For the group to be required, at least one radio needs to be required
|
||||
$group.each(function (i, e) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e).attr('required')) {
|
||||
required = true;
|
||||
}
|
||||
});
|
||||
if (!required) valid = true;
|
||||
|
||||
if (!valid) {
|
||||
// For the group to be valid, at least one radio needs to be checked
|
||||
$group.each(function (i, e) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e).prop('checked')) {
|
||||
valid = true;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if a selected input passes a custom validation function. Multiple validations can be used, if passed to the element with `data-validator="foo bar baz"` in a space separated listed.
|
||||
* @param {Object} $el - jQuery input element.
|
||||
* @param {String} validators - a string of function names matching functions in the Abide.options.validators object.
|
||||
* @param {Boolean} required - self explanatory?
|
||||
* @returns {Boolean} - true if validations passed.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'matchValidation',
|
||||
value: function matchValidation($el, validators, required) {
|
||||
var _this5 = this;
|
||||
|
||||
required = required ? true : false;
|
||||
|
||||
var clear = validators.split(' ').map(function (v) {
|
||||
return _this5.options.validators[v]($el, required, $el.parent());
|
||||
});
|
||||
return clear.indexOf(false) === -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets form inputs and styles
|
||||
* @fires Abide#formreset
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'resetForm',
|
||||
value: function resetForm() {
|
||||
var $form = this.$element,
|
||||
opts = this.options;
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.' + opts.labelErrorClass, $form).not('small').removeClass(opts.labelErrorClass);
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.' + opts.inputErrorClass, $form).not('small').removeClass(opts.inputErrorClass);
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(opts.formErrorSelector + '.' + opts.formErrorClass).removeClass(opts.formErrorClass);
|
||||
$form.find('[data-abide-error]').css('display', 'none');
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').removeAttr('data-invalid');
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(':input:radio', $form).not('[data-abide-ignore]').prop('checked', false).removeAttr('data-invalid');
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked', false).removeAttr('data-invalid');
|
||||
/**
|
||||
* Fires when the form has been reset.
|
||||
* @event Abide#formreset
|
||||
*/
|
||||
$form.trigger('formreset.zf.abide', [$form]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys an instance of Abide.
|
||||
* Removes error styles and classes from elements, without resetting their values.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
var _this = this;
|
||||
this.$element.off('.abide').find('[data-abide-error]').css('display', 'none');
|
||||
|
||||
this.$inputs.off('.abide').each(function () {
|
||||
_this.removeErrorClasses(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this));
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return Abide;
|
||||
}(__WEBPACK_IMPORTED_MODULE_1__foundation_plugin__["Plugin"]);
|
||||
|
||||
/**
|
||||
* Default settings for plugin
|
||||
*/
|
||||
|
||||
|
||||
Abide.defaults = {
|
||||
/**
|
||||
* The default event to validate inputs. Checkboxes and radios validate immediately.
|
||||
* Remove or change this value for manual validation.
|
||||
* @option
|
||||
* @type {?string}
|
||||
* @default 'fieldChange'
|
||||
*/
|
||||
validateOn: 'fieldChange',
|
||||
|
||||
/**
|
||||
* Class to be applied to input labels on failed validation.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'is-invalid-label'
|
||||
*/
|
||||
labelErrorClass: 'is-invalid-label',
|
||||
|
||||
/**
|
||||
* Class to be applied to inputs on failed validation.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'is-invalid-input'
|
||||
*/
|
||||
inputErrorClass: 'is-invalid-input',
|
||||
|
||||
/**
|
||||
* Class selector to use to target Form Errors for show/hide.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default '.form-error'
|
||||
*/
|
||||
formErrorSelector: '.form-error',
|
||||
|
||||
/**
|
||||
* Class added to Form Errors on failed validation.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'is-visible'
|
||||
*/
|
||||
formErrorClass: 'is-visible',
|
||||
|
||||
/**
|
||||
* Set to true to validate text inputs on any value change.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
liveValidate: false,
|
||||
|
||||
/**
|
||||
* Set to true to validate inputs on blur.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
validateOnBlur: false,
|
||||
|
||||
patterns: {
|
||||
alpha: /^[a-zA-Z]+$/,
|
||||
alpha_numeric: /^[a-zA-Z0-9]+$/,
|
||||
integer: /^[-+]?\d+$/,
|
||||
number: /^[-+]?\d*(?:[\.\,]\d+)?$/,
|
||||
|
||||
// amex, visa, diners
|
||||
card: /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(?:222[1-9]|2[3-6][0-9]{2}|27[0-1][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
|
||||
cvv: /^([0-9]){3,4}$/,
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
|
||||
email: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,
|
||||
|
||||
url: /^(https?|ftp|file|ssh):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/,
|
||||
// abc.de
|
||||
domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
|
||||
|
||||
datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
|
||||
// YYYY-MM-DD
|
||||
date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
|
||||
// HH:MM:SS
|
||||
time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
|
||||
dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
|
||||
// MM/DD/YYYY
|
||||
month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
|
||||
// DD/MM/YYYY
|
||||
day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
|
||||
|
||||
// #FFF or #FFFFFF
|
||||
color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,
|
||||
|
||||
// Domain || URL
|
||||
website: {
|
||||
test: function (text) {
|
||||
return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Optional validation functions to be used. `equalTo` being the only default included function.
|
||||
* Functions should return only a boolean if the input is valid or not. Functions are given the following arguments:
|
||||
* el : The jQuery element to validate.
|
||||
* required : Boolean value of the required attribute be present or not.
|
||||
* parent : The direct parent of the input.
|
||||
* @option
|
||||
*/
|
||||
validators: {
|
||||
equalTo: function (el, required, parent) {
|
||||
return __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + el.attr('data-equalto')).val() === el.val();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 79:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(13);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,511 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 80);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 14:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_accordion__ = __webpack_require__(44);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_accordion__["a" /* Accordion */], 'Accordion');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 44:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Accordion; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(5);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Accordion module.
|
||||
* @module foundation.accordion
|
||||
* @requires foundation.util.keyboard
|
||||
*/
|
||||
|
||||
var Accordion = function (_Plugin) {
|
||||
_inherits(Accordion, _Plugin);
|
||||
|
||||
function Accordion() {
|
||||
_classCallCheck(this, Accordion);
|
||||
|
||||
return _possibleConstructorReturn(this, (Accordion.__proto__ || Object.getPrototypeOf(Accordion)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Accordion, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of an accordion.
|
||||
* @class
|
||||
* @name Accordion
|
||||
* @fires Accordion#init
|
||||
* @param {jQuery} element - jQuery object to make into an accordion.
|
||||
* @param {Object} options - a plain object with settings to override the default options.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Accordion.defaults, this.$element.data(), options);
|
||||
|
||||
this.className = 'Accordion'; // ie9 back compat
|
||||
this._init();
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('Accordion', {
|
||||
'ENTER': 'toggle',
|
||||
'SPACE': 'toggle',
|
||||
'ARROW_DOWN': 'next',
|
||||
'ARROW_UP': 'previous'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the accordion by animating the preset active pane(s).
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
var _this3 = this;
|
||||
|
||||
this.$element.attr('role', 'tablist');
|
||||
this.$tabs = this.$element.children('[data-accordion-item]');
|
||||
|
||||
this.$tabs.each(function (idx, el) {
|
||||
var $el = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el),
|
||||
$content = $el.children('[data-tab-content]'),
|
||||
id = $content[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["GetYoDigits"])(6, 'accordion'),
|
||||
linkId = el.id || id + '-label';
|
||||
|
||||
$el.find('a:first').attr({
|
||||
'aria-controls': id,
|
||||
'role': 'tab',
|
||||
'id': linkId,
|
||||
'aria-expanded': false,
|
||||
'aria-selected': false
|
||||
});
|
||||
|
||||
$content.attr({ 'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id });
|
||||
});
|
||||
var $initActive = this.$element.find('.is-active').children('[data-tab-content]');
|
||||
this.firstTimeInit = true;
|
||||
if ($initActive.length) {
|
||||
this.down($initActive, this.firstTimeInit);
|
||||
this.firstTimeInit = false;
|
||||
}
|
||||
|
||||
this._checkDeepLink = function () {
|
||||
var anchor = window.location.hash;
|
||||
//need a hash and a relevant anchor in this tabset
|
||||
if (anchor.length) {
|
||||
var $link = _this3.$element.find('[href$="' + anchor + '"]'),
|
||||
$anchor = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(anchor);
|
||||
|
||||
if ($link.length && $anchor) {
|
||||
if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {
|
||||
_this3.down($anchor, _this3.firstTimeInit);
|
||||
_this3.firstTimeInit = false;
|
||||
};
|
||||
|
||||
//roll up a little to show the titles
|
||||
if (_this3.options.deepLinkSmudge) {
|
||||
var _this = _this3;
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).load(function () {
|
||||
var offset = _this.$element.offset();
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').animate({ scrollTop: offset.top }, _this.options.deepLinkSmudgeDelay);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when the zplugin has deeplinked at pageload
|
||||
* @event Accordion#deeplink
|
||||
*/
|
||||
_this3.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//use browser to open a tab, if it exists in this tabset
|
||||
if (this.options.deepLink) {
|
||||
this._checkDeepLink();
|
||||
}
|
||||
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event handlers for items within the accordion.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this;
|
||||
|
||||
this.$tabs.each(function () {
|
||||
var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);
|
||||
var $tabContent = $elem.children('[data-tab-content]');
|
||||
if ($tabContent.length) {
|
||||
$elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) {
|
||||
e.preventDefault();
|
||||
_this.toggle($tabContent);
|
||||
}).on('keydown.zf.accordion', function (e) {
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'Accordion', {
|
||||
toggle: function () {
|
||||
_this.toggle($tabContent);
|
||||
},
|
||||
next: function () {
|
||||
var $a = $elem.next().find('a').focus();
|
||||
if (!_this.options.multiExpand) {
|
||||
$a.trigger('click.zf.accordion');
|
||||
}
|
||||
},
|
||||
previous: function () {
|
||||
var $a = $elem.prev().find('a').focus();
|
||||
if (!_this.options.multiExpand) {
|
||||
$a.trigger('click.zf.accordion');
|
||||
}
|
||||
},
|
||||
handled: function () {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
if (this.options.deepLink) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate', this._checkDeepLink);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the selected content pane's open/close state.
|
||||
* @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'toggle',
|
||||
value: function toggle($target) {
|
||||
if ($target.closest('[data-accordion]').is('[disabled]')) {
|
||||
console.info('Cannot toggle an accordion that is disabled.');
|
||||
return;
|
||||
}
|
||||
if ($target.parent().hasClass('is-active')) {
|
||||
this.up($target);
|
||||
} else {
|
||||
this.down($target);
|
||||
}
|
||||
//either replace or update browser history
|
||||
if (this.options.deepLink) {
|
||||
var anchor = $target.prev('a').attr('href');
|
||||
|
||||
if (this.options.updateHistory) {
|
||||
history.pushState({}, '', anchor);
|
||||
} else {
|
||||
history.replaceState({}, '', anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the accordion tab defined by `$target`.
|
||||
* @param {jQuery} $target - Accordion pane to open (`.accordion-content`).
|
||||
* @param {Boolean} firstTime - flag to determine if reflow should happen.
|
||||
* @fires Accordion#down
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'down',
|
||||
value: function down($target, firstTime) {
|
||||
var _this4 = this;
|
||||
|
||||
/**
|
||||
* checking firstTime allows for initial render of the accordion
|
||||
* to render preset is-active panes.
|
||||
*/
|
||||
if ($target.closest('[data-accordion]').is('[disabled]') && !firstTime) {
|
||||
console.info('Cannot call down on an accordion that is disabled.');
|
||||
return;
|
||||
}
|
||||
$target.attr('aria-hidden', false).parent('[data-tab-content]').addBack().parent().addClass('is-active');
|
||||
|
||||
if (!this.options.multiExpand && !firstTime) {
|
||||
var $currentActive = this.$element.children('.is-active').children('[data-tab-content]');
|
||||
if ($currentActive.length) {
|
||||
this.up($currentActive.not($target));
|
||||
}
|
||||
}
|
||||
|
||||
$target.slideDown(this.options.slideSpeed, function () {
|
||||
/**
|
||||
* Fires when the tab is done opening.
|
||||
* @event Accordion#down
|
||||
*/
|
||||
_this4.$element.trigger('down.zf.accordion', [$target]);
|
||||
});
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + $target.attr('aria-labelledby')).attr({
|
||||
'aria-expanded': true,
|
||||
'aria-selected': true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the tab defined by `$target`.
|
||||
* @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
|
||||
* @fires Accordion#up
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'up',
|
||||
value: function up($target) {
|
||||
if ($target.closest('[data-accordion]').is('[disabled]')) {
|
||||
console.info('Cannot call up on an accordion that is disabled.');
|
||||
return;
|
||||
}
|
||||
|
||||
var $aunts = $target.parent().siblings(),
|
||||
_this = this;
|
||||
|
||||
if (!this.options.allowAllClosed && !$aunts.hasClass('is-active') || !$target.parent().hasClass('is-active')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$target.slideUp(_this.options.slideSpeed, function () {
|
||||
/**
|
||||
* Fires when the tab is done collapsing up.
|
||||
* @event Accordion#up
|
||||
*/
|
||||
_this.$element.trigger('up.zf.accordion', [$target]);
|
||||
});
|
||||
|
||||
$target.attr('aria-hidden', true).parent().removeClass('is-active');
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + $target.attr('aria-labelledby')).attr({
|
||||
'aria-expanded': false,
|
||||
'aria-selected': false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys an instance of an accordion.
|
||||
* @fires Accordion#destroyed
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');
|
||||
this.$element.find('a').off('.zf.accordion');
|
||||
if (this.options.deepLink) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._checkDeepLink);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return Accordion;
|
||||
}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["Plugin"]);
|
||||
|
||||
Accordion.defaults = {
|
||||
/**
|
||||
* Amount of time to animate the opening of an accordion pane.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 250
|
||||
*/
|
||||
slideSpeed: 250,
|
||||
/**
|
||||
* Allow the accordion to have multiple open panes.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
multiExpand: false,
|
||||
/**
|
||||
* Allow the accordion to close all panes.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
allowAllClosed: false,
|
||||
/**
|
||||
* Allows the window to scroll to content of pane specified by hash anchor
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
deepLink: false,
|
||||
|
||||
/**
|
||||
* Adjust the deep link scroll to make sure the top of the accordion panel is visible
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
deepLinkSmudge: false,
|
||||
|
||||
/**
|
||||
* Animation time (ms) for the deep link adjustment
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 300
|
||||
*/
|
||||
deepLinkSmudgeDelay: 300,
|
||||
|
||||
/**
|
||||
* Update the browser history with the open accordion
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
updateHistory: false
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Keyboard: window.Foundation.Keyboard};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 80:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(14);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,527 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 81);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 15:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_accordionMenu__ = __webpack_require__(45);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_accordionMenu__["a" /* AccordionMenu */], 'AccordionMenu');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 45:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AccordionMenu; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(5);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__ = __webpack_require__(9);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* AccordionMenu module.
|
||||
* @module foundation.accordionMenu
|
||||
* @requires foundation.util.keyboard
|
||||
* @requires foundation.util.nest
|
||||
*/
|
||||
|
||||
var AccordionMenu = function (_Plugin) {
|
||||
_inherits(AccordionMenu, _Plugin);
|
||||
|
||||
function AccordionMenu() {
|
||||
_classCallCheck(this, AccordionMenu);
|
||||
|
||||
return _possibleConstructorReturn(this, (AccordionMenu.__proto__ || Object.getPrototypeOf(AccordionMenu)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(AccordionMenu, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of an accordion menu.
|
||||
* @class
|
||||
* @name AccordionMenu
|
||||
* @fires AccordionMenu#init
|
||||
* @param {jQuery} element - jQuery object to make into an accordion menu.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options);
|
||||
this.className = 'AccordionMenu'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('AccordionMenu', {
|
||||
'ENTER': 'toggle',
|
||||
'SPACE': 'toggle',
|
||||
'ARROW_RIGHT': 'open',
|
||||
'ARROW_UP': 'up',
|
||||
'ARROW_DOWN': 'down',
|
||||
'ARROW_LEFT': 'close',
|
||||
'ESCAPE': 'closeAll'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the accordion menu by hiding all nested menus.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["Nest"].Feather(this.$element, 'accordion');
|
||||
|
||||
var _this = this;
|
||||
|
||||
this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem');
|
||||
this.$element.attr({
|
||||
'role': 'tree',
|
||||
'aria-multiselectable': this.options.multiOpen
|
||||
});
|
||||
|
||||
this.$menuLinks = this.$element.find('.is-accordion-submenu-parent');
|
||||
this.$menuLinks.each(function () {
|
||||
var linkId = this.id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["GetYoDigits"])(6, 'acc-menu-link'),
|
||||
$elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
$sub = $elem.children('[data-submenu]'),
|
||||
subId = $sub[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["GetYoDigits"])(6, 'acc-menu'),
|
||||
isActive = $sub.hasClass('is-active');
|
||||
|
||||
if (_this.options.submenuToggle) {
|
||||
$elem.addClass('has-submenu-toggle');
|
||||
$elem.children('a').after('<button id="' + linkId + '" class="submenu-toggle" aria-controls="' + subId + '" aria-expanded="' + isActive + '" title="' + _this.options.submenuToggleText + '"><span class="submenu-toggle-text">' + _this.options.submenuToggleText + '</span></button>');
|
||||
} else {
|
||||
$elem.attr({
|
||||
'aria-controls': subId,
|
||||
'aria-expanded': isActive,
|
||||
'id': linkId
|
||||
});
|
||||
}
|
||||
$sub.attr({
|
||||
'aria-labelledby': linkId,
|
||||
'aria-hidden': !isActive,
|
||||
'role': 'group',
|
||||
'id': subId
|
||||
});
|
||||
});
|
||||
this.$element.find('li').attr({
|
||||
'role': 'treeitem'
|
||||
});
|
||||
var initPanes = this.$element.find('.is-active');
|
||||
if (initPanes.length) {
|
||||
var _this = this;
|
||||
initPanes.each(function () {
|
||||
_this.down(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this));
|
||||
});
|
||||
}
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event handlers for items within the menu.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this;
|
||||
|
||||
this.$element.find('li').each(function () {
|
||||
var $submenu = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('[data-submenu]');
|
||||
|
||||
if ($submenu.length) {
|
||||
if (_this.options.submenuToggle) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
|
||||
_this.toggle($submenu);
|
||||
});
|
||||
} else {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
|
||||
e.preventDefault();
|
||||
_this.toggle($submenu);
|
||||
});
|
||||
}
|
||||
}
|
||||
}).on('keydown.zf.accordionmenu', function (e) {
|
||||
var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
$elements = $element.parent('ul').children('li'),
|
||||
$prevElement,
|
||||
$nextElement,
|
||||
$target = $element.children('[data-submenu]');
|
||||
|
||||
$elements.each(function (i) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) {
|
||||
$prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first();
|
||||
$nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first();
|
||||
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('[data-submenu]:visible').length) {
|
||||
// has open sub menu
|
||||
$nextElement = $element.find('li:first-child').find('a').first();
|
||||
}
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is(':first-child')) {
|
||||
// is first element of sub menu
|
||||
$prevElement = $element.parents('li').first().find('a').first();
|
||||
} else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) {
|
||||
// if previous element has open sub menu
|
||||
$prevElement = $prevElement.parents('li').find('li:last-child').find('a').first();
|
||||
}
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is(':last-child')) {
|
||||
// is last element of sub menu
|
||||
$nextElement = $element.parents('li').first().next('li').find('a').first();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'AccordionMenu', {
|
||||
open: function () {
|
||||
if ($target.is(':hidden')) {
|
||||
_this.down($target);
|
||||
$target.find('li').first().find('a').first().focus();
|
||||
}
|
||||
},
|
||||
close: function () {
|
||||
if ($target.length && !$target.is(':hidden')) {
|
||||
// close active sub of this item
|
||||
_this.up($target);
|
||||
} else if ($element.parent('[data-submenu]').length) {
|
||||
// close currently open sub
|
||||
_this.up($element.parent('[data-submenu]'));
|
||||
$element.parents('li').first().find('a').first().focus();
|
||||
}
|
||||
},
|
||||
up: function () {
|
||||
$prevElement.focus();
|
||||
return true;
|
||||
},
|
||||
down: function () {
|
||||
$nextElement.focus();
|
||||
return true;
|
||||
},
|
||||
toggle: function () {
|
||||
if (_this.options.submenuToggle) {
|
||||
return false;
|
||||
}
|
||||
if ($element.children('[data-submenu]').length) {
|
||||
_this.toggle($element.children('[data-submenu]'));
|
||||
return true;
|
||||
}
|
||||
},
|
||||
closeAll: function () {
|
||||
_this.hideAll();
|
||||
},
|
||||
handled: function (preventDefault) {
|
||||
if (preventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
});
|
||||
}); //.attr('tabindex', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes all panes of the menu.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'hideAll',
|
||||
value: function hideAll() {
|
||||
this.up(this.$element.find('[data-submenu]'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens all panes of the menu.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'showAll',
|
||||
value: function showAll() {
|
||||
this.down(this.$element.find('[data-submenu]'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the open/close state of a submenu.
|
||||
* @function
|
||||
* @param {jQuery} $target - the submenu to toggle
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'toggle',
|
||||
value: function toggle($target) {
|
||||
if (!$target.is(':animated')) {
|
||||
if (!$target.is(':hidden')) {
|
||||
this.up($target);
|
||||
} else {
|
||||
this.down($target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the sub-menu defined by `$target`.
|
||||
* @param {jQuery} $target - Sub-menu to open.
|
||||
* @fires AccordionMenu#down
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'down',
|
||||
value: function down($target) {
|
||||
var _this = this;
|
||||
|
||||
if (!this.options.multiOpen) {
|
||||
this.up(this.$element.find('.is-active').not($target.parentsUntil(this.$element).add($target)));
|
||||
}
|
||||
|
||||
$target.addClass('is-active').attr({ 'aria-hidden': false });
|
||||
|
||||
if (this.options.submenuToggle) {
|
||||
$target.prev('.submenu-toggle').attr({ 'aria-expanded': true });
|
||||
} else {
|
||||
$target.parent('.is-accordion-submenu-parent').attr({ 'aria-expanded': true });
|
||||
}
|
||||
|
||||
$target.slideDown(_this.options.slideSpeed, function () {
|
||||
/**
|
||||
* Fires when the menu is done opening.
|
||||
* @event AccordionMenu#down
|
||||
*/
|
||||
_this.$element.trigger('down.zf.accordionMenu', [$target]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well.
|
||||
* @param {jQuery} $target - Sub-menu to close.
|
||||
* @fires AccordionMenu#up
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'up',
|
||||
value: function up($target) {
|
||||
var _this = this;
|
||||
$target.slideUp(_this.options.slideSpeed, function () {
|
||||
/**
|
||||
* Fires when the menu is done collapsing up.
|
||||
* @event AccordionMenu#up
|
||||
*/
|
||||
_this.$element.trigger('up.zf.accordionMenu', [$target]);
|
||||
});
|
||||
|
||||
var $menus = $target.find('[data-submenu]').slideUp(0).addBack().attr('aria-hidden', true);
|
||||
|
||||
if (this.options.submenuToggle) {
|
||||
$menus.prev('.submenu-toggle').attr('aria-expanded', false);
|
||||
} else {
|
||||
$menus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys an instance of accordion menu.
|
||||
* @fires AccordionMenu#destroyed
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$element.find('[data-submenu]').slideDown(0).css('display', '');
|
||||
this.$element.find('a').off('click.zf.accordionMenu');
|
||||
|
||||
if (this.options.submenuToggle) {
|
||||
this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle');
|
||||
this.$element.find('.submenu-toggle').remove();
|
||||
}
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["Nest"].Burn(this.$element, 'accordion');
|
||||
}
|
||||
}]);
|
||||
|
||||
return AccordionMenu;
|
||||
}(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__["Plugin"]);
|
||||
|
||||
AccordionMenu.defaults = {
|
||||
/**
|
||||
* Amount of time to animate the opening of a submenu in ms.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 250
|
||||
*/
|
||||
slideSpeed: 250,
|
||||
/**
|
||||
* Adds a separate submenu toggle button. This allows the parent item to have a link.
|
||||
* @option
|
||||
* @example true
|
||||
*/
|
||||
submenuToggle: false,
|
||||
/**
|
||||
* The text used for the submenu toggle if enabled. This is used for screen readers only.
|
||||
* @option
|
||||
* @example true
|
||||
*/
|
||||
submenuToggleText: 'Toggle menu',
|
||||
/**
|
||||
* Allow the menu to have multiple open panes.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
multiOpen: true
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Keyboard: window.Foundation.Keyboard};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 81:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(15);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 9:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Nest: window.Foundation.Nest};
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,860 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 6);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
/* 1 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return rtl; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return GetYoDigits; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transitionend; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
|
||||
|
||||
|
||||
|
||||
// Core Foundation Utilities, utilized in a number of places.
|
||||
|
||||
/**
|
||||
* Returns a boolean for RTL support
|
||||
*/
|
||||
function rtl() {
|
||||
return __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html').attr('dir') === 'rtl';
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a random base-36 uid with namespacing
|
||||
* @function
|
||||
* @param {Number} length - number of random base-36 digits desired. Increase for more random strings.
|
||||
* @param {String} namespace - name of plugin to be incorporated in uid, optional.
|
||||
* @default {String} '' - if no plugin name is provided, nothing is appended to the uid.
|
||||
* @returns {String} - unique id
|
||||
*/
|
||||
function GetYoDigits(length, namespace) {
|
||||
length = length || 6;
|
||||
return Math.round(Math.pow(36, length + 1) - Math.random() * Math.pow(36, length)).toString(36).slice(1) + (namespace ? '-' + namespace : '');
|
||||
}
|
||||
|
||||
function transitionend($elem) {
|
||||
var transitions = {
|
||||
'transition': 'transitionend',
|
||||
'WebkitTransition': 'webkitTransitionEnd',
|
||||
'MozTransition': 'transitionend',
|
||||
'OTransition': 'otransitionend'
|
||||
};
|
||||
var elem = document.createElement('div'),
|
||||
end;
|
||||
|
||||
for (var t in transitions) {
|
||||
if (typeof elem.style[t] !== 'undefined') {
|
||||
end = transitions[t];
|
||||
}
|
||||
}
|
||||
if (end) {
|
||||
return end;
|
||||
} else {
|
||||
end = setTimeout(function () {
|
||||
$elem.triggerHandler('transitionend', [$elem]);
|
||||
}, 1);
|
||||
return 'transitionend';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 2 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(4);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_core__["a" /* Foundation */].addToJquery(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a);
|
||||
|
||||
// These are now separated out, but historically were a part of this module,
|
||||
// and since this is here for backwards compatibility we include them in
|
||||
// this entry.
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_core__["a" /* Foundation */].rtl = __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["a" /* rtl */];
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_core__["a" /* Foundation */].GetYoDigits = __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["b" /* GetYoDigits */];
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_core__["a" /* Foundation */].transitionend = __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["c" /* transitionend */];
|
||||
|
||||
// Every plugin depends on plugin now, we can include that on the core for the
|
||||
// script inclusion path.
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_core__["a" /* Foundation */].Plugin = __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["a" /* Plugin */];
|
||||
|
||||
window.Foundation = __WEBPACK_IMPORTED_MODULE_1__foundation_core__["a" /* Foundation */];
|
||||
|
||||
/***/ }),
|
||||
/* 3 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Foundation; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__ = __webpack_require__(5);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var FOUNDATION_VERSION = '6.4.3';
|
||||
|
||||
// Global Foundation object
|
||||
// This is attached to the window, or used as a module for AMD/Browserify
|
||||
var Foundation = {
|
||||
version: FOUNDATION_VERSION,
|
||||
|
||||
/**
|
||||
* Stores initialized plugins.
|
||||
*/
|
||||
_plugins: {},
|
||||
|
||||
/**
|
||||
* Stores generated unique ids for plugin instances
|
||||
*/
|
||||
_uuids: [],
|
||||
|
||||
/**
|
||||
* Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing.
|
||||
* @param {Object} plugin - The constructor of the plugin.
|
||||
*/
|
||||
plugin: function (plugin, name) {
|
||||
// Object key to use when adding to global Foundation object
|
||||
// Examples: Foundation.Reveal, Foundation.OffCanvas
|
||||
var className = name || functionName(plugin);
|
||||
// Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin
|
||||
// Examples: data-reveal, data-off-canvas
|
||||
var attrName = hyphenate(className);
|
||||
|
||||
// Add to the Foundation object and the plugins list (for reflowing)
|
||||
this._plugins[attrName] = this[className] = plugin;
|
||||
},
|
||||
/**
|
||||
* @function
|
||||
* Populates the _uuids array with pointers to each individual plugin instance.
|
||||
* Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.
|
||||
* Also fires the initialization event for each plugin, consolidating repetitive code.
|
||||
* @param {Object} plugin - an instance of a plugin, usually `this` in context.
|
||||
* @param {String} name - the name of the plugin, passed as a camelCased string.
|
||||
* @fires Plugin#init
|
||||
*/
|
||||
registerPlugin: function (plugin, name) {
|
||||
var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();
|
||||
plugin.uuid = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["b" /* GetYoDigits */])(6, pluginName);
|
||||
|
||||
if (!plugin.$element.attr('data-' + pluginName)) {
|
||||
plugin.$element.attr('data-' + pluginName, plugin.uuid);
|
||||
}
|
||||
if (!plugin.$element.data('zfPlugin')) {
|
||||
plugin.$element.data('zfPlugin', plugin);
|
||||
}
|
||||
/**
|
||||
* Fires when the plugin has initialized.
|
||||
* @event Plugin#init
|
||||
*/
|
||||
plugin.$element.trigger('init.zf.' + pluginName);
|
||||
|
||||
this._uuids.push(plugin.uuid);
|
||||
|
||||
return;
|
||||
},
|
||||
/**
|
||||
* @function
|
||||
* Removes the plugins uuid from the _uuids array.
|
||||
* Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.
|
||||
* Also fires the destroyed event for the plugin, consolidating repetitive code.
|
||||
* @param {Object} plugin - an instance of a plugin, usually `this` in context.
|
||||
* @fires Plugin#destroyed
|
||||
*/
|
||||
unregisterPlugin: function (plugin) {
|
||||
var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));
|
||||
|
||||
this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);
|
||||
plugin.$element.removeAttr('data-' + pluginName).removeData('zfPlugin')
|
||||
/**
|
||||
* Fires when the plugin has been destroyed.
|
||||
* @event Plugin#destroyed
|
||||
*/
|
||||
.trigger('destroyed.zf.' + pluginName);
|
||||
for (var prop in plugin) {
|
||||
plugin[prop] = null; //clean up script to prep for garbage collection.
|
||||
}
|
||||
return;
|
||||
},
|
||||
|
||||
/**
|
||||
* @function
|
||||
* Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc.
|
||||
* @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'`
|
||||
* @default If no argument is passed, reflow all currently active plugins.
|
||||
*/
|
||||
reInit: function (plugins) {
|
||||
var isJQ = plugins instanceof __WEBPACK_IMPORTED_MODULE_0_jquery___default.a;
|
||||
try {
|
||||
if (isJQ) {
|
||||
plugins.each(function () {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('zfPlugin')._init();
|
||||
});
|
||||
} else {
|
||||
var type = typeof plugins,
|
||||
_this = this,
|
||||
fns = {
|
||||
'object': function (plgs) {
|
||||
plgs.forEach(function (p) {
|
||||
p = hyphenate(p);
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-' + p + ']').foundation('_init');
|
||||
});
|
||||
},
|
||||
'string': function () {
|
||||
plugins = hyphenate(plugins);
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-' + plugins + ']').foundation('_init');
|
||||
},
|
||||
'undefined': function () {
|
||||
this['object'](Object.keys(_this._plugins));
|
||||
}
|
||||
};
|
||||
fns[type](plugins);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
return plugins;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized.
|
||||
* @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object.
|
||||
* @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything.
|
||||
*/
|
||||
reflow: function (elem, plugins) {
|
||||
|
||||
// If plugins is undefined, just grab everything
|
||||
if (typeof plugins === 'undefined') {
|
||||
plugins = Object.keys(this._plugins);
|
||||
}
|
||||
// If plugins is a string, convert it to an array with one item
|
||||
else if (typeof plugins === 'string') {
|
||||
plugins = [plugins];
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
|
||||
// Iterate through each plugin
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(plugins, function (i, name) {
|
||||
// Get the current plugin
|
||||
var plugin = _this._plugins[name];
|
||||
|
||||
// Localize the search to all elements inside elem, as well as elem itself, unless elem === document
|
||||
var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(elem).find('[data-' + name + ']').addBack('[data-' + name + ']');
|
||||
|
||||
// For each plugin found, initialize it
|
||||
$elem.each(function () {
|
||||
var $el = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
opts = {};
|
||||
// Don't double-dip on plugins
|
||||
if ($el.data('zfPlugin')) {
|
||||
console.warn("Tried to initialize " + name + " on an element that already has a Foundation plugin.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($el.attr('data-options')) {
|
||||
var thing = $el.attr('data-options').split(';').forEach(function (e, i) {
|
||||
var opt = e.split(':').map(function (el) {
|
||||
return el.trim();
|
||||
});
|
||||
if (opt[0]) opts[opt[0]] = parseValue(opt[1]);
|
||||
});
|
||||
}
|
||||
try {
|
||||
$el.data('zfPlugin', new plugin(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), opts));
|
||||
} catch (er) {
|
||||
console.error(er);
|
||||
} finally {
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
getFnName: functionName,
|
||||
|
||||
addToJquery: function ($) {
|
||||
// TODO: consider not making this a jQuery function
|
||||
// TODO: need way to reflow vs. re-initialize
|
||||
/**
|
||||
* The Foundation jQuery method.
|
||||
* @param {String|Array} method - An action to perform on the current jQuery object.
|
||||
*/
|
||||
var foundation = function (method) {
|
||||
var type = typeof method,
|
||||
$noJS = $('.no-js');
|
||||
|
||||
if ($noJS.length) {
|
||||
$noJS.removeClass('no-js');
|
||||
}
|
||||
|
||||
if (type === 'undefined') {
|
||||
//needs to initialize the Foundation object, or an individual plugin.
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__["a" /* MediaQuery */]._init();
|
||||
Foundation.reflow(this);
|
||||
} else if (type === 'string') {
|
||||
//an individual method to invoke on a plugin or group of plugins
|
||||
var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary
|
||||
var plugClass = this.data('zfPlugin'); //determine the class of plugin
|
||||
|
||||
if (plugClass !== undefined && plugClass[method] !== undefined) {
|
||||
//make sure both the class and method exist
|
||||
if (this.length === 1) {
|
||||
//if there's only one, call it directly.
|
||||
plugClass[method].apply(plugClass, args);
|
||||
} else {
|
||||
this.each(function (i, el) {
|
||||
//otherwise loop through the jQuery collection and invoke the method on each
|
||||
plugClass[method].apply($(el).data('zfPlugin'), args);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
//error for no class or no method
|
||||
throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.');
|
||||
}
|
||||
} else {
|
||||
//error for invalid argument type
|
||||
throw new TypeError('We\'re sorry, ' + type + ' is not a valid parameter. You must use a string representing the method you wish to invoke.');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
$.fn.foundation = foundation;
|
||||
return $;
|
||||
}
|
||||
};
|
||||
|
||||
Foundation.util = {
|
||||
/**
|
||||
* Function for applying a debounce effect to a function call.
|
||||
* @function
|
||||
* @param {Function} func - Function to be called at end of timeout.
|
||||
* @param {Number} delay - Time in ms to delay the call of `func`.
|
||||
* @returns function
|
||||
*/
|
||||
throttle: function (func, delay) {
|
||||
var timer = null;
|
||||
|
||||
return function () {
|
||||
var context = this,
|
||||
args = arguments;
|
||||
|
||||
if (timer === null) {
|
||||
timer = setTimeout(function () {
|
||||
func.apply(context, args);
|
||||
timer = null;
|
||||
}, delay);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
window.Foundation = Foundation;
|
||||
|
||||
// Polyfill for requestAnimationFrame
|
||||
(function () {
|
||||
if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () {
|
||||
return new Date().getTime();
|
||||
};
|
||||
|
||||
var vendors = ['webkit', 'moz'];
|
||||
for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
|
||||
var vp = vendors[i];
|
||||
window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
|
||||
window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame'];
|
||||
}
|
||||
if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
|
||||
var lastTime = 0;
|
||||
window.requestAnimationFrame = function (callback) {
|
||||
var now = Date.now();
|
||||
var nextTime = Math.max(lastTime + 16, now);
|
||||
return setTimeout(function () {
|
||||
callback(lastTime = nextTime);
|
||||
}, nextTime - now);
|
||||
};
|
||||
window.cancelAnimationFrame = clearTimeout;
|
||||
}
|
||||
/**
|
||||
* Polyfill for performance.now, required by rAF
|
||||
*/
|
||||
if (!window.performance || !window.performance.now) {
|
||||
window.performance = {
|
||||
start: Date.now(),
|
||||
now: function () {
|
||||
return Date.now() - this.start;
|
||||
}
|
||||
};
|
||||
}
|
||||
})();
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function (oThis) {
|
||||
if (typeof this !== 'function') {
|
||||
// closest thing possible to the ECMAScript 5
|
||||
// internal IsCallable function
|
||||
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
|
||||
}
|
||||
|
||||
var aArgs = Array.prototype.slice.call(arguments, 1),
|
||||
fToBind = this,
|
||||
fNOP = function () {},
|
||||
fBound = function () {
|
||||
return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
|
||||
};
|
||||
|
||||
if (this.prototype) {
|
||||
// native functions don't have a prototype
|
||||
fNOP.prototype = this.prototype;
|
||||
}
|
||||
fBound.prototype = new fNOP();
|
||||
|
||||
return fBound;
|
||||
};
|
||||
}
|
||||
// Polyfill to get the name of a function in IE9
|
||||
function functionName(fn) {
|
||||
if (Function.prototype.name === undefined) {
|
||||
var funcNameRegex = /function\s([^(]{1,})\(/;
|
||||
var results = funcNameRegex.exec(fn.toString());
|
||||
return results && results.length > 1 ? results[1].trim() : "";
|
||||
} else if (fn.prototype === undefined) {
|
||||
return fn.constructor.name;
|
||||
} else {
|
||||
return fn.prototype.constructor.name;
|
||||
}
|
||||
}
|
||||
function parseValue(str) {
|
||||
if ('true' === str) return true;else if ('false' === str) return false;else if (!isNaN(str * 1)) return parseFloat(str);
|
||||
return str;
|
||||
}
|
||||
// Convert PascalCase to kebab-case
|
||||
// Thank you: http://stackoverflow.com/a/8955580
|
||||
function hyphenate(str) {
|
||||
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 4 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Plugin; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(1);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
|
||||
|
||||
|
||||
// Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST
|
||||
// {function} _setup (replaces previous constructor),
|
||||
// {function} _destroy (replaces previous destroy)
|
||||
|
||||
var Plugin = function () {
|
||||
function Plugin(element, options) {
|
||||
_classCallCheck(this, Plugin);
|
||||
|
||||
this._setup(element, options);
|
||||
var pluginName = getPluginName(this);
|
||||
this.uuid = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["b" /* GetYoDigits */])(6, pluginName);
|
||||
|
||||
if (!this.$element.attr('data-' + pluginName)) {
|
||||
this.$element.attr('data-' + pluginName, this.uuid);
|
||||
}
|
||||
if (!this.$element.data('zfPlugin')) {
|
||||
this.$element.data('zfPlugin', this);
|
||||
}
|
||||
/**
|
||||
* Fires when the plugin has initialized.
|
||||
* @event Plugin#init
|
||||
*/
|
||||
this.$element.trigger('init.zf.' + pluginName);
|
||||
}
|
||||
|
||||
_createClass(Plugin, [{
|
||||
key: 'destroy',
|
||||
value: function destroy() {
|
||||
this._destroy();
|
||||
var pluginName = getPluginName(this);
|
||||
this.$element.removeAttr('data-' + pluginName).removeData('zfPlugin')
|
||||
/**
|
||||
* Fires when the plugin has been destroyed.
|
||||
* @event Plugin#destroyed
|
||||
*/
|
||||
.trigger('destroyed.zf.' + pluginName);
|
||||
for (var prop in this) {
|
||||
this[prop] = null; //clean up script to prep for garbage collection.
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return Plugin;
|
||||
}();
|
||||
|
||||
// Convert PascalCase to kebab-case
|
||||
// Thank you: http://stackoverflow.com/a/8955580
|
||||
|
||||
|
||||
function hyphenate(str) {
|
||||
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
}
|
||||
|
||||
function getPluginName(obj) {
|
||||
if (typeof obj.constructor.name !== 'undefined') {
|
||||
return hyphenate(obj.constructor.name);
|
||||
} else {
|
||||
return hyphenate(obj.className);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 5 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MediaQuery; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
|
||||
|
||||
|
||||
|
||||
// Default set of media queries
|
||||
var defaultQueries = {
|
||||
'default': 'only screen',
|
||||
landscape: 'only screen and (orientation: landscape)',
|
||||
portrait: 'only screen and (orientation: portrait)',
|
||||
retina: 'only screen and (-webkit-min-device-pixel-ratio: 2),' + 'only screen and (min--moz-device-pixel-ratio: 2),' + 'only screen and (-o-min-device-pixel-ratio: 2/1),' + 'only screen and (min-device-pixel-ratio: 2),' + 'only screen and (min-resolution: 192dpi),' + 'only screen and (min-resolution: 2dppx)'
|
||||
};
|
||||
|
||||
// matchMedia() polyfill - Test a CSS media type/query in JS.
|
||||
// Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license
|
||||
var matchMedia = window.matchMedia || function () {
|
||||
'use strict';
|
||||
|
||||
// For browsers that support matchMedium api such as IE 9 and webkit
|
||||
|
||||
var styleMedia = window.styleMedia || window.media;
|
||||
|
||||
// For those that don't support matchMedium
|
||||
if (!styleMedia) {
|
||||
var style = document.createElement('style'),
|
||||
script = document.getElementsByTagName('script')[0],
|
||||
info = null;
|
||||
|
||||
style.type = 'text/css';
|
||||
style.id = 'matchmediajs-test';
|
||||
|
||||
script && script.parentNode && script.parentNode.insertBefore(style, script);
|
||||
|
||||
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
|
||||
info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle;
|
||||
|
||||
styleMedia = {
|
||||
matchMedium: function (media) {
|
||||
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
|
||||
|
||||
// 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = text;
|
||||
} else {
|
||||
style.textContent = text;
|
||||
}
|
||||
|
||||
// Test if media query is true or false
|
||||
return info.width === '1px';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return function (media) {
|
||||
return {
|
||||
matches: styleMedia.matchMedium(media || 'all'),
|
||||
media: media || 'all'
|
||||
};
|
||||
};
|
||||
}();
|
||||
|
||||
var MediaQuery = {
|
||||
queries: [],
|
||||
|
||||
current: '',
|
||||
|
||||
/**
|
||||
* Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
_init: function () {
|
||||
var self = this;
|
||||
var $meta = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('meta.foundation-mq');
|
||||
if (!$meta.length) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('<meta class="foundation-mq">').appendTo(document.head);
|
||||
}
|
||||
|
||||
var extractedStyles = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.foundation-mq').css('font-family');
|
||||
var namedQueries;
|
||||
|
||||
namedQueries = parseStyleToObject(extractedStyles);
|
||||
|
||||
for (var key in namedQueries) {
|
||||
if (namedQueries.hasOwnProperty(key)) {
|
||||
self.queries.push({
|
||||
name: key,
|
||||
value: 'only screen and (min-width: ' + namedQueries[key] + ')'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.current = this._getCurrentSize();
|
||||
|
||||
this._watcher();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the screen is at least as wide as a breakpoint.
|
||||
* @function
|
||||
* @param {String} size - Name of the breakpoint to check.
|
||||
* @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.
|
||||
*/
|
||||
atLeast: function (size) {
|
||||
var query = this.get(size);
|
||||
|
||||
if (query) {
|
||||
return matchMedia(query).matches;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the screen matches to a breakpoint.
|
||||
* @function
|
||||
* @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method.
|
||||
* @returns {Boolean} `true` if the breakpoint matches, `false` if it does not.
|
||||
*/
|
||||
is: function (size) {
|
||||
size = size.trim().split(' ');
|
||||
if (size.length > 1 && size[1] === 'only') {
|
||||
if (size[0] === this._getCurrentSize()) return true;
|
||||
} else {
|
||||
return this.atLeast(size[0]);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Gets the media query of a breakpoint.
|
||||
* @function
|
||||
* @param {String} size - Name of the breakpoint to get.
|
||||
* @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.
|
||||
*/
|
||||
get: function (size) {
|
||||
for (var i in this.queries) {
|
||||
if (this.queries.hasOwnProperty(i)) {
|
||||
var query = this.queries[i];
|
||||
if (size === query.name) return query.value;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).
|
||||
* @function
|
||||
* @private
|
||||
* @returns {String} Name of the current breakpoint.
|
||||
*/
|
||||
_getCurrentSize: function () {
|
||||
var matched;
|
||||
|
||||
for (var i = 0; i < this.queries.length; i++) {
|
||||
var query = this.queries[i];
|
||||
|
||||
if (matchMedia(query.value).matches) {
|
||||
matched = query;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof matched === 'object') {
|
||||
return matched.name;
|
||||
} else {
|
||||
return matched;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
_watcher: function () {
|
||||
var _this = this;
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', function () {
|
||||
var newSize = _this._getCurrentSize(),
|
||||
currentSize = _this.current;
|
||||
|
||||
if (newSize !== currentSize) {
|
||||
// Change the current media query
|
||||
_this.current = newSize;
|
||||
|
||||
// Broadcast the media query change on the window
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Thank you: https://github.com/sindresorhus/query-string
|
||||
function parseStyleToObject(str) {
|
||||
var styleObject = {};
|
||||
|
||||
if (typeof str !== 'string') {
|
||||
return styleObject;
|
||||
}
|
||||
|
||||
str = str.trim().slice(1, -1); // browsers re-quote string style values
|
||||
|
||||
if (!str) {
|
||||
return styleObject;
|
||||
}
|
||||
|
||||
styleObject = str.split('&').reduce(function (ret, param) {
|
||||
var parts = param.replace(/\+/g, ' ').split('=');
|
||||
var key = parts[0];
|
||||
var val = parts[1];
|
||||
key = decodeURIComponent(key);
|
||||
|
||||
// missing `=` should be `null`:
|
||||
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
|
||||
val = val === undefined ? null : decodeURIComponent(val);
|
||||
|
||||
if (!ret.hasOwnProperty(key)) {
|
||||
ret[key] = val;
|
||||
} else if (Array.isArray(ret[key])) {
|
||||
ret[key].push(val);
|
||||
} else {
|
||||
ret[key] = [ret[key], val];
|
||||
}
|
||||
return ret;
|
||||
}, {});
|
||||
|
||||
return styleObject;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 6 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(2);
|
||||
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,759 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 82);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 16:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_drilldown__ = __webpack_require__(46);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_drilldown__["a" /* Drilldown */], 'Drilldown');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 46:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Drilldown; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(5);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__ = __webpack_require__(9);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_box__ = __webpack_require__(8);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_box___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_util_box__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Drilldown module.
|
||||
* @module foundation.drilldown
|
||||
* @requires foundation.util.keyboard
|
||||
* @requires foundation.util.nest
|
||||
* @requires foundation.util.box
|
||||
*/
|
||||
|
||||
var Drilldown = function (_Plugin) {
|
||||
_inherits(Drilldown, _Plugin);
|
||||
|
||||
function Drilldown() {
|
||||
_classCallCheck(this, Drilldown);
|
||||
|
||||
return _possibleConstructorReturn(this, (Drilldown.__proto__ || Object.getPrototypeOf(Drilldown)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Drilldown, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of a drilldown menu.
|
||||
* @class
|
||||
* @name Drilldown
|
||||
* @param {jQuery} element - jQuery object to make into an accordion menu.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Drilldown.defaults, this.$element.data(), options);
|
||||
this.className = 'Drilldown'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('Drilldown', {
|
||||
'ENTER': 'open',
|
||||
'SPACE': 'open',
|
||||
'ARROW_RIGHT': 'next',
|
||||
'ARROW_UP': 'up',
|
||||
'ARROW_DOWN': 'down',
|
||||
'ARROW_LEFT': 'previous',
|
||||
'ESCAPE': 'close',
|
||||
'TAB': 'down',
|
||||
'SHIFT_TAB': 'up'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the drilldown by creating jQuery collections of elements
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["Nest"].Feather(this.$element, 'drilldown');
|
||||
|
||||
if (this.options.autoApplyClass) {
|
||||
this.$element.addClass('drilldown');
|
||||
}
|
||||
|
||||
this.$element.attr({
|
||||
'role': 'tree',
|
||||
'aria-multiselectable': false
|
||||
});
|
||||
this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');
|
||||
this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');
|
||||
this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a');
|
||||
this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["GetYoDigits"])(6, 'drilldown'));
|
||||
|
||||
this._prepareMenu();
|
||||
this._registerEvents();
|
||||
|
||||
this._keyboardEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* prepares drilldown menu by setting attributes to links and elements
|
||||
* sets a min height to prevent content jumping
|
||||
* wraps the element if not already wrapped
|
||||
* @private
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_prepareMenu',
|
||||
value: function _prepareMenu() {
|
||||
var _this = this;
|
||||
// if(!this.options.holdOpen){
|
||||
// this._menuLinkEvents();
|
||||
// }
|
||||
this.$submenuAnchors.each(function () {
|
||||
var $link = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);
|
||||
var $sub = $link.parent();
|
||||
if (_this.options.parentLink) {
|
||||
$link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="menuitem"></li>');
|
||||
}
|
||||
$link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);
|
||||
$link.children('[data-submenu]').attr({
|
||||
'aria-hidden': true,
|
||||
'tabindex': 0,
|
||||
'role': 'group'
|
||||
});
|
||||
_this._events($link);
|
||||
});
|
||||
this.$submenus.each(function () {
|
||||
var $menu = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
$back = $menu.find('.js-drilldown-back');
|
||||
if (!$back.length) {
|
||||
switch (_this.options.backButtonPosition) {
|
||||
case "bottom":
|
||||
$menu.append(_this.options.backButton);
|
||||
break;
|
||||
case "top":
|
||||
$menu.prepend(_this.options.backButton);
|
||||
break;
|
||||
default:
|
||||
console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'");
|
||||
}
|
||||
}
|
||||
_this._back($menu);
|
||||
});
|
||||
|
||||
this.$submenus.addClass('invisible');
|
||||
if (!this.options.autoHeight) {
|
||||
this.$submenus.addClass('drilldown-submenu-cover-previous');
|
||||
}
|
||||
|
||||
// create a wrapper on element if it doesn't exist.
|
||||
if (!this.$element.parent().hasClass('is-drilldown')) {
|
||||
this.$wrapper = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.wrapper).addClass('is-drilldown');
|
||||
if (this.options.animateHeight) this.$wrapper.addClass('animate-height');
|
||||
this.$element.wrap(this.$wrapper);
|
||||
}
|
||||
// set wrapper
|
||||
this.$wrapper = this.$element.parent();
|
||||
this.$wrapper.css(this._getMaxDims());
|
||||
}
|
||||
}, {
|
||||
key: '_resize',
|
||||
value: function _resize() {
|
||||
this.$wrapper.css({ 'max-width': 'none', 'min-height': 'none' });
|
||||
// _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths
|
||||
this.$wrapper.css(this._getMaxDims());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event handlers to elements in the menu.
|
||||
* @function
|
||||
* @private
|
||||
* @param {jQuery} $elem - the current menu item to add handlers to.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events($elem) {
|
||||
var _this = this;
|
||||
|
||||
$elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// if(e.target !== e.currentTarget.firstElementChild){
|
||||
// return false;
|
||||
// }
|
||||
_this._show($elem.parent('li'));
|
||||
|
||||
if (_this.options.closeOnClick) {
|
||||
var $body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('body');
|
||||
$body.off('.zf.drilldown').on('click.zf.drilldown', function (e) {
|
||||
if (e.target === _this.$element[0] || __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.contains(_this.$element[0], e.target)) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
_this._hideAll();
|
||||
$body.off('.zf.drilldown');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event handlers to the menu element.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_registerEvents',
|
||||
value: function _registerEvents() {
|
||||
if (this.options.scrollTop) {
|
||||
this._bindHandler = this._scrollTop.bind(this);
|
||||
this.$element.on('open.zf.drilldown hide.zf.drilldown closed.zf.drilldown', this._bindHandler);
|
||||
}
|
||||
this.$element.on('mutateme.zf.trigger', this._resize.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Scroll to Top of Element or data-scroll-top-element
|
||||
* @function
|
||||
* @fires Drilldown#scrollme
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_scrollTop',
|
||||
value: function _scrollTop() {
|
||||
var _this = this;
|
||||
var $scrollTopElement = _this.options.scrollTopElement != '' ? __WEBPACK_IMPORTED_MODULE_0_jquery___default()(_this.options.scrollTopElement) : _this.$element,
|
||||
scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10);
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').stop(true).animate({ scrollTop: scrollPos }, _this.options.animationDuration, _this.options.animationEasing, function () {
|
||||
/**
|
||||
* Fires after the menu has scrolled
|
||||
* @event Drilldown#scrollme
|
||||
*/
|
||||
if (this === __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds keydown event listener to `li`'s in the menu.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_keyboardEvents',
|
||||
value: function _keyboardEvents() {
|
||||
var _this = this;
|
||||
|
||||
this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) {
|
||||
var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
$elements = $element.parent('li').parent('ul').children('li').children('a'),
|
||||
$prevElement,
|
||||
$nextElement;
|
||||
|
||||
$elements.each(function (i) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) {
|
||||
$prevElement = $elements.eq(Math.max(0, i - 1));
|
||||
$nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'Drilldown', {
|
||||
next: function () {
|
||||
if ($element.is(_this.$submenuAnchors)) {
|
||||
_this._show($element.parent('li'));
|
||||
$element.parent('li').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($element), function () {
|
||||
$element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
|
||||
});
|
||||
return true;
|
||||
}
|
||||
},
|
||||
previous: function () {
|
||||
_this._hide($element.parent('li').parent('ul'));
|
||||
$element.parent('li').parent('ul').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($element), function () {
|
||||
setTimeout(function () {
|
||||
$element.parent('li').parent('ul').parent('li').children('a').first().focus();
|
||||
}, 1);
|
||||
});
|
||||
return true;
|
||||
},
|
||||
up: function () {
|
||||
$prevElement.focus();
|
||||
// Don't tap focus on first element in root ul
|
||||
return !$element.is(_this.$element.find('> li:first-child > a'));
|
||||
},
|
||||
down: function () {
|
||||
$nextElement.focus();
|
||||
// Don't tap focus on last element in root ul
|
||||
return !$element.is(_this.$element.find('> li:last-child > a'));
|
||||
},
|
||||
close: function () {
|
||||
// Don't close on element in root ul
|
||||
if (!$element.is(_this.$element.find('> li > a'))) {
|
||||
_this._hide($element.parent().parent());
|
||||
$element.parent().parent().siblings('a').focus();
|
||||
}
|
||||
},
|
||||
open: function () {
|
||||
if (!$element.is(_this.$menuItems)) {
|
||||
// not menu item means back button
|
||||
_this._hide($element.parent('li').parent('ul'));
|
||||
$element.parent('li').parent('ul').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($element), function () {
|
||||
setTimeout(function () {
|
||||
$element.parent('li').parent('ul').parent('li').children('a').first().focus();
|
||||
}, 1);
|
||||
});
|
||||
return true;
|
||||
} else if ($element.is(_this.$submenuAnchors)) {
|
||||
_this._show($element.parent('li'));
|
||||
$element.parent('li').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($element), function () {
|
||||
$element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
|
||||
});
|
||||
return true;
|
||||
}
|
||||
},
|
||||
handled: function (preventDefault) {
|
||||
if (preventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
});
|
||||
}); // end keyboardAccess
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes all open elements, and returns to root menu.
|
||||
* @function
|
||||
* @fires Drilldown#closed
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_hideAll',
|
||||
value: function _hideAll() {
|
||||
var $elem = this.$element.find('.is-drilldown-submenu.is-active').addClass('is-closing');
|
||||
if (this.options.autoHeight) this.$wrapper.css({ height: $elem.parent().closest('ul').data('calcHeight') });
|
||||
$elem.one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($elem), function (e) {
|
||||
$elem.removeClass('is-active is-closing');
|
||||
});
|
||||
/**
|
||||
* Fires when the menu is fully closed.
|
||||
* @event Drilldown#closed
|
||||
*/
|
||||
this.$element.trigger('closed.zf.drilldown');
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event listener for each `back` button, and closes open menus.
|
||||
* @function
|
||||
* @fires Drilldown#back
|
||||
* @param {jQuery} $elem - the current sub-menu to add `back` event.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_back',
|
||||
value: function _back($elem) {
|
||||
var _this = this;
|
||||
$elem.off('click.zf.drilldown');
|
||||
$elem.children('.js-drilldown-back').on('click.zf.drilldown', function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
// console.log('mouseup on back');
|
||||
_this._hide($elem);
|
||||
|
||||
// If there is a parent submenu, call show
|
||||
var parentSubMenu = $elem.parent('li').parent('ul').parent('li');
|
||||
if (parentSubMenu.length) {
|
||||
_this._show(parentSubMenu);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event listener to menu items w/o submenus to close open menus on click.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_menuLinkEvents',
|
||||
value: function _menuLinkEvents() {
|
||||
var _this = this;
|
||||
this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
|
||||
// e.stopImmediatePropagation();
|
||||
setTimeout(function () {
|
||||
_this._hideAll();
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a submenu.
|
||||
* @function
|
||||
* @fires Drilldown#open
|
||||
* @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_show',
|
||||
value: function _show($elem) {
|
||||
if (this.options.autoHeight) this.$wrapper.css({ height: $elem.children('[data-submenu]').data('calcHeight') });
|
||||
$elem.attr('aria-expanded', true);
|
||||
$elem.children('[data-submenu]').addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
|
||||
/**
|
||||
* Fires when the submenu has opened.
|
||||
* @event Drilldown#open
|
||||
*/
|
||||
this.$element.trigger('open.zf.drilldown', [$elem]);
|
||||
}
|
||||
}, {
|
||||
key: '_hide',
|
||||
|
||||
|
||||
/**
|
||||
* Hides a submenu
|
||||
* @function
|
||||
* @fires Drilldown#hide
|
||||
* @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag.
|
||||
*/
|
||||
value: function _hide($elem) {
|
||||
if (this.options.autoHeight) this.$wrapper.css({ height: $elem.parent().closest('ul').data('calcHeight') });
|
||||
var _this = this;
|
||||
$elem.parent('li').attr('aria-expanded', false);
|
||||
$elem.attr('aria-hidden', true).addClass('is-closing');
|
||||
$elem.addClass('is-closing').one(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["transitionend"])($elem), function () {
|
||||
$elem.removeClass('is-active is-closing');
|
||||
$elem.blur().addClass('invisible');
|
||||
});
|
||||
/**
|
||||
* Fires when the submenu has closed.
|
||||
* @event Drilldown#hide
|
||||
*/
|
||||
$elem.trigger('hide.zf.drilldown', [$elem]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates through the nested menus to calculate the min-height, and max-width for the menu.
|
||||
* Prevents content jumping.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_getMaxDims',
|
||||
value: function _getMaxDims() {
|
||||
var maxHeight = 0,
|
||||
result = {},
|
||||
_this = this;
|
||||
this.$submenus.add(this.$element).each(function () {
|
||||
var numOfElems = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).children('li').length;
|
||||
var height = __WEBPACK_IMPORTED_MODULE_4__foundation_util_box__["Box"].GetDimensions(this).height;
|
||||
maxHeight = height > maxHeight ? height : maxHeight;
|
||||
if (_this.options.autoHeight) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('calcHeight', height);
|
||||
if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).hasClass('is-drilldown-submenu')) result['height'] = height;
|
||||
}
|
||||
});
|
||||
|
||||
if (!this.options.autoHeight) result['min-height'] = maxHeight + 'px';
|
||||
|
||||
result['max-width'] = this.$element[0].getBoundingClientRect().width + 'px';
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the Drilldown Menu
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler);
|
||||
this._hideAll();
|
||||
this.$element.off('mutateme.zf.trigger');
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["Nest"].Burn(this.$element, 'drilldown');
|
||||
this.$element.unwrap().find('.js-drilldown-back, .is-submenu-parent-item').remove().end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu').end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');
|
||||
this.$submenuAnchors.each(function () {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).off('.zf.drilldown');
|
||||
});
|
||||
|
||||
this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');
|
||||
|
||||
this.$element.find('a').each(function () {
|
||||
var $link = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);
|
||||
$link.removeAttr('tabindex');
|
||||
if ($link.data('savedHref')) {
|
||||
$link.attr('href', $link.data('savedHref')).removeData('savedHref');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return Drilldown;
|
||||
}(__WEBPACK_IMPORTED_MODULE_5__foundation_plugin__["Plugin"]);
|
||||
|
||||
Drilldown.defaults = {
|
||||
/**
|
||||
* Drilldowns depend on styles in order to function properly; in the default build of Foundation these are
|
||||
* on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization.
|
||||
* @option
|
||||
* @type {boolian}
|
||||
* @default true
|
||||
*/
|
||||
autoApplyClass: true,
|
||||
/**
|
||||
* Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>'
|
||||
*/
|
||||
backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>',
|
||||
/**
|
||||
* Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default top
|
||||
*/
|
||||
backButtonPosition: 'top',
|
||||
/**
|
||||
* Markup used to wrap drilldown menu. Use a class name for independent styling; the JS applied class: `is-drilldown` is required. Remove the backslash (`\`) if copy and pasting.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default '<div></div>'
|
||||
*/
|
||||
wrapper: '<div></div>',
|
||||
/**
|
||||
* Adds the parent link to the submenu.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
parentLink: false,
|
||||
/**
|
||||
* Allow the menu to return to root list on body click.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
closeOnClick: false,
|
||||
/**
|
||||
* Allow the menu to auto adjust height.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
autoHeight: false,
|
||||
/**
|
||||
* Animate the auto adjust height.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
animateHeight: false,
|
||||
/**
|
||||
* Scroll to the top of the menu after opening a submenu or navigating back using the menu back button
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
scrollTop: false,
|
||||
/**
|
||||
* String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default ''
|
||||
*/
|
||||
scrollTopElement: '',
|
||||
/**
|
||||
* ScrollTop offset
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 0
|
||||
*/
|
||||
scrollTopOffset: 0,
|
||||
/**
|
||||
* Scroll animation duration
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 500
|
||||
*/
|
||||
animationDuration: 500,
|
||||
/**
|
||||
* Scroll animation easing. Can be `'swing'` or `'linear'`.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @see {@link https://api.jquery.com/animate|JQuery animate}
|
||||
* @default 'swing'
|
||||
*/
|
||||
animationEasing: 'swing'
|
||||
// holdOpen: false
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Keyboard: window.Foundation.Keyboard};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Box: window.Foundation.Box};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 82:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(16);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 9:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Nest: window.Foundation.Nest};
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,677 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 84);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 18:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_dropdownMenu__ = __webpack_require__(48);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_dropdownMenu__["a" /* DropdownMenu */], 'DropdownMenu');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 48:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DropdownMenu; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(5);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__ = __webpack_require__(9);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_box__ = __webpack_require__(8);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_box___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_util_box__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* DropdownMenu module.
|
||||
* @module foundation.dropdown-menu
|
||||
* @requires foundation.util.keyboard
|
||||
* @requires foundation.util.box
|
||||
* @requires foundation.util.nest
|
||||
*/
|
||||
|
||||
var DropdownMenu = function (_Plugin) {
|
||||
_inherits(DropdownMenu, _Plugin);
|
||||
|
||||
function DropdownMenu() {
|
||||
_classCallCheck(this, DropdownMenu);
|
||||
|
||||
return _possibleConstructorReturn(this, (DropdownMenu.__proto__ || Object.getPrototypeOf(DropdownMenu)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(DropdownMenu, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of DropdownMenu.
|
||||
* @class
|
||||
* @name DropdownMenu
|
||||
* @fires DropdownMenu#init
|
||||
* @param {jQuery} element - jQuery object to make into a dropdown menu.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, DropdownMenu.defaults, this.$element.data(), options);
|
||||
this.className = 'DropdownMenu'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('DropdownMenu', {
|
||||
'ENTER': 'open',
|
||||
'SPACE': 'open',
|
||||
'ARROW_RIGHT': 'next',
|
||||
'ARROW_UP': 'up',
|
||||
'ARROW_DOWN': 'down',
|
||||
'ARROW_LEFT': 'previous',
|
||||
'ESCAPE': 'close'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the plugin, and calls _prepareMenu
|
||||
* @private
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["Nest"].Feather(this.$element, 'dropdown');
|
||||
|
||||
var subs = this.$element.find('li.is-dropdown-submenu-parent');
|
||||
this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub');
|
||||
|
||||
this.$menuItems = this.$element.find('[role="menuitem"]');
|
||||
this.$tabs = this.$element.children('[role="menuitem"]');
|
||||
this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass);
|
||||
|
||||
if (this.options.alignment === 'auto') {
|
||||
if (this.$element.hasClass(this.options.rightClass) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__foundation_util_core__["rtl"])() || this.$element.parents('.top-bar-right').is('*')) {
|
||||
this.options.alignment = 'right';
|
||||
subs.addClass('opens-left');
|
||||
} else {
|
||||
this.options.alignment = 'left';
|
||||
subs.addClass('opens-right');
|
||||
}
|
||||
} else {
|
||||
if (this.options.alignment === 'right') {
|
||||
subs.addClass('opens-left');
|
||||
} else {
|
||||
subs.addClass('opens-right');
|
||||
}
|
||||
}
|
||||
this.changed = false;
|
||||
this._events();
|
||||
}
|
||||
}, {
|
||||
key: '_isVertical',
|
||||
value: function _isVertical() {
|
||||
return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column';
|
||||
}
|
||||
}, {
|
||||
key: '_isRtl',
|
||||
value: function _isRtl() {
|
||||
return this.$element.hasClass('align-right') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__foundation_util_core__["rtl"])() && !this.$element.hasClass('align-left');
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event listeners to elements within the menu
|
||||
* @private
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this,
|
||||
hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined',
|
||||
parClass = 'is-dropdown-submenu-parent';
|
||||
|
||||
// used for onClick and in the keyboard handlers
|
||||
var handleClickFn = function (e) {
|
||||
var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).parentsUntil('ul', '.' + parClass),
|
||||
hasSub = $elem.hasClass(parClass),
|
||||
hasClicked = $elem.attr('data-is-click') === 'true',
|
||||
$sub = $elem.children('.is-dropdown-submenu');
|
||||
|
||||
if (hasSub) {
|
||||
if (hasClicked) {
|
||||
if (!_this.options.closeOnClick || !_this.options.clickOpen && !hasTouch || _this.options.forceFollow && hasTouch) {
|
||||
return;
|
||||
} else {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
_this._hide($elem);
|
||||
}
|
||||
} else {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
_this._show($sub);
|
||||
$elem.add($elem.parentsUntil(_this.$element, '.' + parClass)).attr('data-is-click', true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (this.options.clickOpen || hasTouch) {
|
||||
this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', handleClickFn);
|
||||
}
|
||||
|
||||
// Handle Leaf element Clicks
|
||||
if (_this.options.closeOnClickInside) {
|
||||
this.$menuItems.on('click.zf.dropdownmenu', function (e) {
|
||||
var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
hasSub = $elem.hasClass(parClass);
|
||||
if (!hasSub) {
|
||||
_this._hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.options.disableHover) {
|
||||
this.$menuItems.on('mouseenter.zf.dropdownmenu', function (e) {
|
||||
var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
hasSub = $elem.hasClass(parClass);
|
||||
|
||||
if (hasSub) {
|
||||
clearTimeout($elem.data('_delay'));
|
||||
$elem.data('_delay', setTimeout(function () {
|
||||
_this._show($elem.children('.is-dropdown-submenu'));
|
||||
}, _this.options.hoverDelay));
|
||||
}
|
||||
}).on('mouseleave.zf.dropdownmenu', function (e) {
|
||||
var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
hasSub = $elem.hasClass(parClass);
|
||||
if (hasSub && _this.options.autoclose) {
|
||||
if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) {
|
||||
return false;
|
||||
}
|
||||
|
||||
clearTimeout($elem.data('_delay'));
|
||||
$elem.data('_delay', setTimeout(function () {
|
||||
_this._hide($elem);
|
||||
}, _this.options.closingTime));
|
||||
}
|
||||
});
|
||||
}
|
||||
this.$menuItems.on('keydown.zf.dropdownmenu', function (e) {
|
||||
var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).parentsUntil('ul', '[role="menuitem"]'),
|
||||
isTab = _this.$tabs.index($element) > -1,
|
||||
$elements = isTab ? _this.$tabs : $element.siblings('li').add($element),
|
||||
$prevElement,
|
||||
$nextElement;
|
||||
|
||||
$elements.each(function (i) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) {
|
||||
$prevElement = $elements.eq(i - 1);
|
||||
$nextElement = $elements.eq(i + 1);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
var nextSibling = function () {
|
||||
$nextElement.children('a:first').focus();
|
||||
e.preventDefault();
|
||||
},
|
||||
prevSibling = function () {
|
||||
$prevElement.children('a:first').focus();
|
||||
e.preventDefault();
|
||||
},
|
||||
openSub = function () {
|
||||
var $sub = $element.children('ul.is-dropdown-submenu');
|
||||
if ($sub.length) {
|
||||
_this._show($sub);
|
||||
$element.find('li > a:first').focus();
|
||||
e.preventDefault();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
},
|
||||
closeSub = function () {
|
||||
//if ($element.is(':first-child')) {
|
||||
var close = $element.parent('ul').parent('li');
|
||||
close.children('a:first').focus();
|
||||
_this._hide(close);
|
||||
e.preventDefault();
|
||||
//}
|
||||
};
|
||||
var functions = {
|
||||
open: openSub,
|
||||
close: function () {
|
||||
_this._hide(_this.$element);
|
||||
_this.$menuItems.eq(0).children('a').focus(); // focus to first element
|
||||
e.preventDefault();
|
||||
},
|
||||
handled: function () {
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
};
|
||||
|
||||
if (isTab) {
|
||||
if (_this._isVertical()) {
|
||||
// vertical menu
|
||||
if (_this._isRtl()) {
|
||||
// right aligned
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, {
|
||||
down: nextSibling,
|
||||
up: prevSibling,
|
||||
next: closeSub,
|
||||
previous: openSub
|
||||
});
|
||||
} else {
|
||||
// left aligned
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, {
|
||||
down: nextSibling,
|
||||
up: prevSibling,
|
||||
next: openSub,
|
||||
previous: closeSub
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// horizontal menu
|
||||
if (_this._isRtl()) {
|
||||
// right aligned
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, {
|
||||
next: prevSibling,
|
||||
previous: nextSibling,
|
||||
down: openSub,
|
||||
up: closeSub
|
||||
});
|
||||
} else {
|
||||
// left aligned
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, {
|
||||
next: nextSibling,
|
||||
previous: prevSibling,
|
||||
down: openSub,
|
||||
up: closeSub
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// not tabs -> one sub
|
||||
if (_this._isRtl()) {
|
||||
// right aligned
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, {
|
||||
next: closeSub,
|
||||
previous: openSub,
|
||||
down: nextSibling,
|
||||
up: prevSibling
|
||||
});
|
||||
} else {
|
||||
// left aligned
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend(functions, {
|
||||
next: openSub,
|
||||
previous: closeSub,
|
||||
down: nextSibling,
|
||||
up: prevSibling
|
||||
});
|
||||
}
|
||||
}
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'DropdownMenu', functions);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an event handler to the body to close any dropdowns on a click.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_addBodyHandler',
|
||||
value: function _addBodyHandler() {
|
||||
var $body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document.body),
|
||||
_this = this;
|
||||
$body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu').on('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu', function (e) {
|
||||
var $link = _this.$element.find(e.target);
|
||||
if ($link.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this._hide();
|
||||
$body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a dropdown pane, and checks for collisions first.
|
||||
* @param {jQuery} $sub - ul element that is a submenu to show
|
||||
* @function
|
||||
* @private
|
||||
* @fires DropdownMenu#show
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_show',
|
||||
value: function _show($sub) {
|
||||
var idx = this.$tabs.index(this.$tabs.filter(function (i, el) {
|
||||
return __WEBPACK_IMPORTED_MODULE_0_jquery___default()(el).find($sub).length > 0;
|
||||
}));
|
||||
var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent');
|
||||
this._hide($sibs, idx);
|
||||
$sub.css('visibility', 'hidden').addClass('js-dropdown-active').parent('li.is-dropdown-submenu-parent').addClass('is-active');
|
||||
var clear = __WEBPACK_IMPORTED_MODULE_3__foundation_util_box__["Box"].ImNotTouchingYou($sub, null, true);
|
||||
if (!clear) {
|
||||
var oldClass = this.options.alignment === 'left' ? '-right' : '-left',
|
||||
$parentLi = $sub.parent('.is-dropdown-submenu-parent');
|
||||
$parentLi.removeClass('opens' + oldClass).addClass('opens-' + this.options.alignment);
|
||||
clear = __WEBPACK_IMPORTED_MODULE_3__foundation_util_box__["Box"].ImNotTouchingYou($sub, null, true);
|
||||
if (!clear) {
|
||||
$parentLi.removeClass('opens-' + this.options.alignment).addClass('opens-inner');
|
||||
}
|
||||
this.changed = true;
|
||||
}
|
||||
$sub.css('visibility', '');
|
||||
if (this.options.closeOnClick) {
|
||||
this._addBodyHandler();
|
||||
}
|
||||
/**
|
||||
* Fires when the new dropdown pane is visible.
|
||||
* @event DropdownMenu#show
|
||||
*/
|
||||
this.$element.trigger('show.zf.dropdownmenu', [$sub]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything.
|
||||
* @function
|
||||
* @param {jQuery} $elem - element with a submenu to hide
|
||||
* @param {Number} idx - index of the $tabs collection to hide
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_hide',
|
||||
value: function _hide($elem, idx) {
|
||||
var $toClose;
|
||||
if ($elem && $elem.length) {
|
||||
$toClose = $elem;
|
||||
} else if (idx !== undefined) {
|
||||
$toClose = this.$tabs.not(function (i, el) {
|
||||
return i === idx;
|
||||
});
|
||||
} else {
|
||||
$toClose = this.$element;
|
||||
}
|
||||
var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0;
|
||||
|
||||
if (somethingToClose) {
|
||||
$toClose.find('li.is-active').add($toClose).attr({
|
||||
'data-is-click': false
|
||||
}).removeClass('is-active');
|
||||
|
||||
$toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active');
|
||||
|
||||
if (this.changed || $toClose.find('opens-inner').length) {
|
||||
var oldClass = this.options.alignment === 'left' ? 'right' : 'left';
|
||||
$toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass('opens-inner opens-' + this.options.alignment).addClass('opens-' + oldClass);
|
||||
this.changed = false;
|
||||
}
|
||||
/**
|
||||
* Fires when the open menus are closed.
|
||||
* @event DropdownMenu#hide
|
||||
*/
|
||||
this.$element.trigger('hide.zf.dropdownmenu', [$toClose]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the plugin.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$menuItems.off('.zf.dropdownmenu').removeAttr('data-is-click').removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner');
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(document.body).off('.zf.dropdownmenu');
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__["Nest"].Burn(this.$element, 'dropdown');
|
||||
}
|
||||
}]);
|
||||
|
||||
return DropdownMenu;
|
||||
}(__WEBPACK_IMPORTED_MODULE_5__foundation_plugin__["Plugin"]);
|
||||
|
||||
/**
|
||||
* Default settings for plugin
|
||||
*/
|
||||
|
||||
|
||||
DropdownMenu.defaults = {
|
||||
/**
|
||||
* Disallows hover events from opening submenus
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
disableHover: false,
|
||||
/**
|
||||
* Allow a submenu to automatically close on a mouseleave event, if not clicked open.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
autoclose: true,
|
||||
/**
|
||||
* Amount of time to delay opening a submenu on hover event.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 50
|
||||
*/
|
||||
hoverDelay: 50,
|
||||
/**
|
||||
* Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
clickOpen: false,
|
||||
/**
|
||||
* Amount of time to delay closing a submenu on a mouseleave event.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 500
|
||||
*/
|
||||
|
||||
closingTime: 500,
|
||||
/**
|
||||
* Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'auto'
|
||||
*/
|
||||
alignment: 'auto',
|
||||
/**
|
||||
* Allow clicks on the body to close any open submenus.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
closeOnClick: true,
|
||||
/**
|
||||
* Allow clicks on leaf anchor links to close any open submenus.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
closeOnClickInside: true,
|
||||
/**
|
||||
* Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'vertical'
|
||||
*/
|
||||
verticalClass: 'vertical',
|
||||
/**
|
||||
* Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'align-right'
|
||||
*/
|
||||
rightClass: 'align-right',
|
||||
/**
|
||||
* Boolean to force overide the clicking of links to perform default action, on second touch event for mobile.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
forceFollow: true
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Keyboard: window.Foundation.Keyboard};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Box: window.Foundation.Box};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 84:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(18);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 9:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Nest: window.Foundation.Nest};
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,542 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 85);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 10:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {onImagesLoaded: window.Foundation.onImagesLoaded};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 19:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_equalizer__ = __webpack_require__(49);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_equalizer__["a" /* Equalizer */], 'Equalizer');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 49:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Equalizer; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(6);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__ = __webpack_require__(10);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Equalizer module.
|
||||
* @module foundation.equalizer
|
||||
* @requires foundation.util.mediaQuery
|
||||
* @requires foundation.util.imageLoader if equalizer contains images
|
||||
*/
|
||||
|
||||
var Equalizer = function (_Plugin) {
|
||||
_inherits(Equalizer, _Plugin);
|
||||
|
||||
function Equalizer() {
|
||||
_classCallCheck(this, Equalizer);
|
||||
|
||||
return _possibleConstructorReturn(this, (Equalizer.__proto__ || Object.getPrototypeOf(Equalizer)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Equalizer, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of Equalizer.
|
||||
* @class
|
||||
* @name Equalizer
|
||||
* @fires Equalizer#init
|
||||
* @param {Object} element - jQuery object to add the trigger to.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Equalizer.defaults, this.$element.data(), options);
|
||||
this.className = 'Equalizer'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Equalizer plugin and calls functions to get equalizer functioning on load.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
var eqId = this.$element.attr('data-equalizer') || '';
|
||||
var $watched = this.$element.find('[data-equalizer-watch="' + eqId + '"]');
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"]._init();
|
||||
|
||||
this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]');
|
||||
this.$element.attr('data-resize', eqId || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["GetYoDigits"])(6, 'eq'));
|
||||
this.$element.attr('data-mutate', eqId || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["GetYoDigits"])(6, 'eq'));
|
||||
|
||||
this.hasNested = this.$element.find('[data-equalizer]').length > 0;
|
||||
this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0;
|
||||
this.isOn = false;
|
||||
this._bindHandler = {
|
||||
onResizeMeBound: this._onResizeMe.bind(this),
|
||||
onPostEqualizedBound: this._onPostEqualized.bind(this)
|
||||
};
|
||||
|
||||
var imgs = this.$element.find('img');
|
||||
var tooSmall;
|
||||
if (this.options.equalizeOn) {
|
||||
tooSmall = this._checkMQ();
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', this._checkMQ.bind(this));
|
||||
} else {
|
||||
this._events();
|
||||
}
|
||||
if (tooSmall !== undefined && tooSmall === false || tooSmall === undefined) {
|
||||
if (imgs.length) {
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__["onImagesLoaded"])(imgs, this._reflow.bind(this));
|
||||
} else {
|
||||
this._reflow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes event listeners if the breakpoint is too small.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_pauseEvents',
|
||||
value: function _pauseEvents() {
|
||||
this.isOn = false;
|
||||
this.$element.off({
|
||||
'.zf.equalizer': this._bindHandler.onPostEqualizedBound,
|
||||
'resizeme.zf.trigger': this._bindHandler.onResizeMeBound,
|
||||
'mutateme.zf.trigger': this._bindHandler.onResizeMeBound
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_onResizeMe',
|
||||
value: function _onResizeMe(e) {
|
||||
this._reflow();
|
||||
}
|
||||
|
||||
/**
|
||||
* function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_onPostEqualized',
|
||||
value: function _onPostEqualized(e) {
|
||||
if (e.target !== this.$element[0]) {
|
||||
this._reflow();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes events for Equalizer.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this;
|
||||
this._pauseEvents();
|
||||
if (this.hasNested) {
|
||||
this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound);
|
||||
} else {
|
||||
this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound);
|
||||
this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound);
|
||||
}
|
||||
this.isOn = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the current breakpoint to the minimum required size.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_checkMQ',
|
||||
value: function _checkMQ() {
|
||||
var tooSmall = !__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"].is(this.options.equalizeOn);
|
||||
if (tooSmall) {
|
||||
if (this.isOn) {
|
||||
this._pauseEvents();
|
||||
this.$watched.css('height', 'auto');
|
||||
}
|
||||
} else {
|
||||
if (!this.isOn) {
|
||||
this._events();
|
||||
}
|
||||
}
|
||||
return tooSmall;
|
||||
}
|
||||
|
||||
/**
|
||||
* A noop version for the plugin
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_killswitch',
|
||||
value: function _killswitch() {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls necessary functions to update Equalizer upon DOM change
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_reflow',
|
||||
value: function _reflow() {
|
||||
if (!this.options.equalizeOnStack) {
|
||||
if (this._isStacked()) {
|
||||
this.$watched.css('height', 'auto');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.options.equalizeByRow) {
|
||||
this.getHeightsByRow(this.applyHeightByRow.bind(this));
|
||||
} else {
|
||||
this.getHeights(this.applyHeight.bind(this));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually determines if the first 2 elements are *NOT* stacked.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_isStacked',
|
||||
value: function _isStacked() {
|
||||
if (!this.$watched[0] || !this.$watched[1]) {
|
||||
return true;
|
||||
}
|
||||
return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the outer heights of children contained within an Equalizer parent and returns them in an array
|
||||
* @param {Function} cb - A non-optional callback to return the heights array to.
|
||||
* @returns {Array} heights - An array of heights of children within Equalizer container
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'getHeights',
|
||||
value: function getHeights(cb) {
|
||||
var heights = [];
|
||||
for (var i = 0, len = this.$watched.length; i < len; i++) {
|
||||
this.$watched[i].style.height = 'auto';
|
||||
heights.push(this.$watched[i].offsetHeight);
|
||||
}
|
||||
cb(heights);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the outer heights of children contained within an Equalizer parent and returns them in an array
|
||||
* @param {Function} cb - A non-optional callback to return the heights array to.
|
||||
* @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'getHeightsByRow',
|
||||
value: function getHeightsByRow(cb) {
|
||||
var lastElTopOffset = this.$watched.length ? this.$watched.first().offset().top : 0,
|
||||
groups = [],
|
||||
group = 0;
|
||||
//group by Row
|
||||
groups[group] = [];
|
||||
for (var i = 0, len = this.$watched.length; i < len; i++) {
|
||||
this.$watched[i].style.height = 'auto';
|
||||
//maybe could use this.$watched[i].offsetTop
|
||||
var elOffsetTop = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.$watched[i]).offset().top;
|
||||
if (elOffsetTop != lastElTopOffset) {
|
||||
group++;
|
||||
groups[group] = [];
|
||||
lastElTopOffset = elOffsetTop;
|
||||
}
|
||||
groups[group].push([this.$watched[i], this.$watched[i].offsetHeight]);
|
||||
}
|
||||
|
||||
for (var j = 0, ln = groups.length; j < ln; j++) {
|
||||
var heights = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(groups[j]).map(function () {
|
||||
return this[1];
|
||||
}).get();
|
||||
var max = Math.max.apply(null, heights);
|
||||
groups[j].push(max);
|
||||
}
|
||||
cb(groups);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the CSS height property of each child in an Equalizer parent to match the tallest
|
||||
* @param {array} heights - An array of heights of children within Equalizer container
|
||||
* @fires Equalizer#preequalized
|
||||
* @fires Equalizer#postequalized
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'applyHeight',
|
||||
value: function applyHeight(heights) {
|
||||
var max = Math.max.apply(null, heights);
|
||||
/**
|
||||
* Fires before the heights are applied
|
||||
* @event Equalizer#preequalized
|
||||
*/
|
||||
this.$element.trigger('preequalized.zf.equalizer');
|
||||
|
||||
this.$watched.css('height', max);
|
||||
|
||||
/**
|
||||
* Fires when the heights have been applied
|
||||
* @event Equalizer#postequalized
|
||||
*/
|
||||
this.$element.trigger('postequalized.zf.equalizer');
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the CSS height property of each child in an Equalizer parent to match the tallest by row
|
||||
* @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
|
||||
* @fires Equalizer#preequalized
|
||||
* @fires Equalizer#preequalizedrow
|
||||
* @fires Equalizer#postequalizedrow
|
||||
* @fires Equalizer#postequalized
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'applyHeightByRow',
|
||||
value: function applyHeightByRow(groups) {
|
||||
/**
|
||||
* Fires before the heights are applied
|
||||
*/
|
||||
this.$element.trigger('preequalized.zf.equalizer');
|
||||
for (var i = 0, len = groups.length; i < len; i++) {
|
||||
var groupsILength = groups[i].length,
|
||||
max = groups[i][groupsILength - 1];
|
||||
if (groupsILength <= 2) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(groups[i][0][0]).css({ 'height': 'auto' });
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* Fires before the heights per row are applied
|
||||
* @event Equalizer#preequalizedrow
|
||||
*/
|
||||
this.$element.trigger('preequalizedrow.zf.equalizer');
|
||||
for (var j = 0, lenJ = groupsILength - 1; j < lenJ; j++) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(groups[i][j][0]).css({ 'height': max });
|
||||
}
|
||||
/**
|
||||
* Fires when the heights per row have been applied
|
||||
* @event Equalizer#postequalizedrow
|
||||
*/
|
||||
this.$element.trigger('postequalizedrow.zf.equalizer');
|
||||
}
|
||||
/**
|
||||
* Fires when the heights have been applied
|
||||
*/
|
||||
this.$element.trigger('postequalized.zf.equalizer');
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys an instance of Equalizer.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this._pauseEvents();
|
||||
this.$watched.css('height', 'auto');
|
||||
}
|
||||
}]);
|
||||
|
||||
return Equalizer;
|
||||
}(__WEBPACK_IMPORTED_MODULE_4__foundation_plugin__["Plugin"]);
|
||||
|
||||
/**
|
||||
* Default settings for plugin
|
||||
*/
|
||||
|
||||
|
||||
Equalizer.defaults = {
|
||||
/**
|
||||
* Enable height equalization when stacked on smaller screens.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
equalizeOnStack: false,
|
||||
/**
|
||||
* Enable height equalization row by row.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
equalizeByRow: false,
|
||||
/**
|
||||
* String representing the minimum breakpoint size the plugin should equalize heights on.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default ''
|
||||
*/
|
||||
equalizeOn: ''
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {MediaQuery: window.Foundation.MediaQuery};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 85:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(19);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,399 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 86);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 20:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_interchange__ = __webpack_require__(50);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_interchange__["a" /* Interchange */], 'Interchange');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 50:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Interchange; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(6);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Interchange module.
|
||||
* @module foundation.interchange
|
||||
* @requires foundation.util.mediaQuery
|
||||
*/
|
||||
|
||||
var Interchange = function (_Plugin) {
|
||||
_inherits(Interchange, _Plugin);
|
||||
|
||||
function Interchange() {
|
||||
_classCallCheck(this, Interchange);
|
||||
|
||||
return _possibleConstructorReturn(this, (Interchange.__proto__ || Object.getPrototypeOf(Interchange)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Interchange, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of Interchange.
|
||||
* @class
|
||||
* @name Interchange
|
||||
* @fires Interchange#init
|
||||
* @param {Object} element - jQuery object to add the trigger to.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Interchange.defaults, options);
|
||||
this.rules = [];
|
||||
this.currentPath = '';
|
||||
this.className = 'Interchange'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Interchange plugin and calls functions to get interchange functioning on load.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"]._init();
|
||||
|
||||
var id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__foundation_util_core__["GetYoDigits"])(6, 'interchange');
|
||||
this.$element.attr({
|
||||
'data-resize': id,
|
||||
'id': id
|
||||
});
|
||||
|
||||
this._addBreakpoints();
|
||||
this._generateRules();
|
||||
this._reflow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes events for Interchange.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this3 = this;
|
||||
|
||||
this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () {
|
||||
return _this3._reflow();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls necessary functions to update Interchange upon DOM change
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_reflow',
|
||||
value: function _reflow() {
|
||||
var match;
|
||||
|
||||
// Iterate through each rule, but only save the last match
|
||||
for (var i in this.rules) {
|
||||
if (this.rules.hasOwnProperty(i)) {
|
||||
var rule = this.rules[i];
|
||||
if (window.matchMedia(rule.query).matches) {
|
||||
match = rule;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (match) {
|
||||
this.replace(match.path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_addBreakpoints',
|
||||
value: function _addBreakpoints() {
|
||||
for (var i in __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"].queries) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"].queries.hasOwnProperty(i)) {
|
||||
var query = __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"].queries[i];
|
||||
Interchange.SPECIAL_QUERIES[query.name] = query.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the Interchange element for the provided media query + content pairings
|
||||
* @function
|
||||
* @private
|
||||
* @param {Object} element - jQuery object that is an Interchange instance
|
||||
* @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_generateRules',
|
||||
value: function _generateRules(element) {
|
||||
var rulesList = [];
|
||||
var rules;
|
||||
|
||||
if (this.options.rules) {
|
||||
rules = this.options.rules;
|
||||
} else {
|
||||
rules = this.$element.data('interchange');
|
||||
}
|
||||
|
||||
rules = typeof rules === 'string' ? rules.match(/\[.*?\]/g) : rules;
|
||||
|
||||
for (var i in rules) {
|
||||
if (rules.hasOwnProperty(i)) {
|
||||
var rule = rules[i].slice(1, -1).split(', ');
|
||||
var path = rule.slice(0, -1).join('');
|
||||
var query = rule[rule.length - 1];
|
||||
|
||||
if (Interchange.SPECIAL_QUERIES[query]) {
|
||||
query = Interchange.SPECIAL_QUERIES[query];
|
||||
}
|
||||
|
||||
rulesList.push({
|
||||
path: path,
|
||||
query: query
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.rules = rulesList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the `src` property of an image, or change the HTML of a container, to the specified path.
|
||||
* @function
|
||||
* @param {String} path - Path to the image or HTML partial.
|
||||
* @fires Interchange#replaced
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'replace',
|
||||
value: function replace(path) {
|
||||
if (this.currentPath === path) return;
|
||||
|
||||
var _this = this,
|
||||
trigger = 'replaced.zf.interchange';
|
||||
|
||||
// Replacing images
|
||||
if (this.$element[0].nodeName === 'IMG') {
|
||||
this.$element.attr('src', path).on('load', function () {
|
||||
_this.currentPath = path;
|
||||
}).trigger(trigger);
|
||||
}
|
||||
// Replacing background images
|
||||
else if (path.match(/\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)) {
|
||||
path = path.replace(/\(/g, '%28').replace(/\)/g, '%29');
|
||||
this.$element.css({ 'background-image': 'url(' + path + ')' }).trigger(trigger);
|
||||
}
|
||||
// Replacing HTML
|
||||
else {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.get(path, function (response) {
|
||||
_this.$element.html(response).trigger(trigger);
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(response).foundation();
|
||||
_this.currentPath = path;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when content in an Interchange element is done being loaded.
|
||||
* @event Interchange#replaced
|
||||
*/
|
||||
// this.$element.trigger('replaced.zf.interchange');
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys an instance of interchange.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$element.off('resizeme.zf.trigger');
|
||||
}
|
||||
}]);
|
||||
|
||||
return Interchange;
|
||||
}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["Plugin"]);
|
||||
|
||||
/**
|
||||
* Default settings for plugin
|
||||
*/
|
||||
|
||||
|
||||
Interchange.defaults = {
|
||||
/**
|
||||
* Rules to be applied to Interchange elements. Set with the `data-interchange` array notation.
|
||||
* @option
|
||||
* @type {?array}
|
||||
* @default null
|
||||
*/
|
||||
rules: null
|
||||
};
|
||||
|
||||
Interchange.SPECIAL_QUERIES = {
|
||||
'landscape': 'screen and (orientation: landscape)',
|
||||
'portrait': 'screen and (orientation: portrait)',
|
||||
'retina': 'only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)'
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {MediaQuery: window.Foundation.MediaQuery};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 86:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(20);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
|
@ -0,0 +1 @@
|
|||
!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=86)}({0:function(e,t){e.exports=jQuery},1:function(e,t){e.exports={Foundation:window.Foundation}},2:function(e,t){e.exports={Plugin:window.Foundation.Plugin}},20:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=(n.n(r),n(50));r.Foundation.plugin(i.a,"Interchange")},3:function(e,t){e.exports={rtl:window.Foundation.rtl,GetYoDigits:window.Foundation.GetYoDigits,transitionend:window.Foundation.transitionend}},50:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"a",function(){return p});var a=n(0),u=n.n(a),s=n(6),c=(n.n(s),n(2)),l=(n.n(c),n(3)),f=(n.n(l),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()),p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),f(t,[{key:"_setup",value:function(e,n){this.$element=e,this.options=u.a.extend({},t.defaults,n),this.rules=[],this.currentPath="",this.className="Interchange",this._init(),this._events()}},{key:"_init",value:function(){s.MediaQuery._init();var e=this.$element[0].id||n.i(l.GetYoDigits)(6,"interchange");this.$element.attr({"data-resize":e,id:e}),this._addBreakpoints(),this._generateRules(),this._reflow()}},{key:"_events",value:function(){var e=this;this.$element.off("resizeme.zf.trigger").on("resizeme.zf.trigger",function(){return e._reflow()})}},{key:"_reflow",value:function(){var e;for(var t in this.rules)if(this.rules.hasOwnProperty(t)){var n=this.rules[t];window.matchMedia(n.query).matches&&(e=n)}e&&this.replace(e.path)}},{key:"_addBreakpoints",value:function(){for(var e in s.MediaQuery.queries)if(s.MediaQuery.queries.hasOwnProperty(e)){var n=s.MediaQuery.queries[e];t.SPECIAL_QUERIES[n.name]=n.value}}},{key:"_generateRules",value:function(e){var n,r=[];n=this.options.rules?this.options.rules:this.$element.data("interchange"),n="string"==typeof n?n.match(/\[.*?\]/g):n;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i].slice(1,-1).split(", "),a=o.slice(0,-1).join(""),u=o[o.length-1];t.SPECIAL_QUERIES[u]&&(u=t.SPECIAL_QUERIES[u]),r.push({path:a,query:u})}this.rules=r}},{key:"replace",value:function(e){if(this.currentPath!==e){var t=this,n="replaced.zf.interchange";"IMG"===this.$element[0].nodeName?this.$element.attr("src",e).on("load",function(){t.currentPath=e}).trigger(n):e.match(/\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)?(e=e.replace(/\(/g,"%28").replace(/\)/g,"%29"),this.$element.css({"background-image":"url("+e+")"}).trigger(n)):u.a.get(e,function(r){t.$element.html(r).trigger(n),u()(r).foundation(),t.currentPath=e})}}},{key:"_destroy",value:function(){this.$element.off("resizeme.zf.trigger")}}]),t}(c.Plugin);p.defaults={rules:null},p.SPECIAL_QUERIES={landscape:"screen and (orientation: landscape)",portrait:"screen and (orientation: portrait)",retina:"only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)"}},6:function(e,t){e.exports={MediaQuery:window.Foundation.MediaQuery}},86:function(e,t,n){e.exports=n(20)}});
|
|
@ -0,0 +1,449 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 87);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 21:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_magellan__ = __webpack_require__(51);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_magellan__["a" /* Magellan */], 'Magellan');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 51:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Magellan; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_smoothScroll__ = __webpack_require__(76);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_smoothScroll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_smoothScroll__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Magellan module.
|
||||
* @module foundation.magellan
|
||||
* @requires foundation.smoothScroll
|
||||
*/
|
||||
|
||||
var Magellan = function (_Plugin) {
|
||||
_inherits(Magellan, _Plugin);
|
||||
|
||||
function Magellan() {
|
||||
_classCallCheck(this, Magellan);
|
||||
|
||||
return _possibleConstructorReturn(this, (Magellan.__proto__ || Object.getPrototypeOf(Magellan)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Magellan, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of Magellan.
|
||||
* @class
|
||||
* @name Magellan
|
||||
* @fires Magellan#init
|
||||
* @param {Object} element - jQuery object to add the trigger to.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Magellan.defaults, this.$element.data(), options);
|
||||
this.className = 'Magellan'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
this.calcPoints();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Magellan plugin and calls functions to get equalizer functioning on load.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
var id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["GetYoDigits"])(6, 'magellan');
|
||||
var _this = this;
|
||||
this.$targets = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-magellan-target]');
|
||||
this.$links = this.$element.find('a');
|
||||
this.$element.attr({
|
||||
'data-resize': id,
|
||||
'data-scroll': id,
|
||||
'id': id
|
||||
});
|
||||
this.$active = __WEBPACK_IMPORTED_MODULE_0_jquery___default()();
|
||||
this.scrollPos = parseInt(window.pageYOffset, 10);
|
||||
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates an array of pixel values that are the demarcation lines between locations on the page.
|
||||
* Can be invoked if new elements are added or the size of a location changes.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'calcPoints',
|
||||
value: function calcPoints() {
|
||||
var _this = this,
|
||||
body = document.body,
|
||||
html = document.documentElement;
|
||||
|
||||
this.points = [];
|
||||
this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));
|
||||
this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));
|
||||
|
||||
this.$targets.each(function () {
|
||||
var $tar = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
pt = Math.round($tar.offset().top - _this.options.threshold);
|
||||
$tar.targetPoint = pt;
|
||||
_this.points.push(pt);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes events for Magellan.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this,
|
||||
$body = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body'),
|
||||
opts = {
|
||||
duration: _this.options.animationDuration,
|
||||
easing: _this.options.animationEasing
|
||||
};
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).one('load', function () {
|
||||
if (_this.options.deepLinking) {
|
||||
if (location.hash) {
|
||||
_this.scrollToLoc(location.hash);
|
||||
}
|
||||
}
|
||||
_this.calcPoints();
|
||||
_this._updateActive();
|
||||
});
|
||||
|
||||
this.$element.on({
|
||||
'resizeme.zf.trigger': this.reflow.bind(this),
|
||||
'scrollme.zf.trigger': this._updateActive.bind(this)
|
||||
}).on('click.zf.magellan', 'a[href^="#"]', function (e) {
|
||||
e.preventDefault();
|
||||
var arrival = this.getAttribute('href');
|
||||
_this.scrollToLoc(arrival);
|
||||
});
|
||||
|
||||
this._deepLinkScroll = function (e) {
|
||||
if (_this.options.deepLinking) {
|
||||
_this.scrollToLoc(window.location.hash);
|
||||
}
|
||||
};
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate', this._deepLinkScroll);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to scroll to a given location on the page.
|
||||
* @param {String} loc - a properly formatted jQuery id selector. Example: '#foo'
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'scrollToLoc',
|
||||
value: function scrollToLoc(loc) {
|
||||
this._inTransition = true;
|
||||
var _this = this;
|
||||
|
||||
var options = {
|
||||
animationEasing: this.options.animationEasing,
|
||||
animationDuration: this.options.animationDuration,
|
||||
threshold: this.options.threshold,
|
||||
offset: this.options.offset
|
||||
};
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_3__foundation_smoothScroll__["SmoothScroll"].scrollToLoc(loc, options, function () {
|
||||
_this._inTransition = false;
|
||||
_this._updateActive();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls necessary functions to update Magellan upon DOM change
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'reflow',
|
||||
value: function reflow() {
|
||||
this.calcPoints();
|
||||
this._updateActive();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled.
|
||||
* @private
|
||||
* @function
|
||||
* @fires Magellan#update
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_updateActive',
|
||||
value: function _updateActive() /*evt, elem, scrollPos*/{
|
||||
if (this._inTransition) {
|
||||
return;
|
||||
}
|
||||
var winPos = /*scrollPos ||*/parseInt(window.pageYOffset, 10),
|
||||
curIdx;
|
||||
|
||||
if (winPos + this.winHeight === this.docHeight) {
|
||||
curIdx = this.points.length - 1;
|
||||
} else if (winPos < this.points[0]) {
|
||||
curIdx = undefined;
|
||||
} else {
|
||||
var isDown = this.scrollPos < winPos,
|
||||
_this = this,
|
||||
curVisible = this.points.filter(function (p, i) {
|
||||
return isDown ? p - _this.options.offset <= winPos : p - _this.options.offset - _this.options.threshold <= winPos;
|
||||
});
|
||||
curIdx = curVisible.length ? curVisible.length - 1 : 0;
|
||||
}
|
||||
|
||||
this.$active.removeClass(this.options.activeClass);
|
||||
this.$active = this.$links.filter('[href="#' + this.$targets.eq(curIdx).data('magellan-target') + '"]').addClass(this.options.activeClass);
|
||||
|
||||
if (this.options.deepLinking) {
|
||||
var hash = "";
|
||||
if (curIdx != undefined) {
|
||||
hash = this.$active[0].getAttribute('href');
|
||||
}
|
||||
if (hash !== window.location.hash) {
|
||||
if (window.history.pushState) {
|
||||
window.history.pushState(null, null, hash);
|
||||
} else {
|
||||
window.location.hash = hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.scrollPos = winPos;
|
||||
/**
|
||||
* Fires when magellan is finished updating to the new active element.
|
||||
* @event Magellan#update
|
||||
*/
|
||||
this.$element.trigger('update.zf.magellan', [this.$active]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys an instance of Magellan and resets the url of the window.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$element.off('.zf.trigger .zf.magellan').find('.' + this.options.activeClass).removeClass(this.options.activeClass);
|
||||
|
||||
if (this.options.deepLinking) {
|
||||
var hash = this.$active[0].getAttribute('href');
|
||||
window.location.hash.replace(hash, '');
|
||||
}
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._deepLinkScroll);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Magellan;
|
||||
}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["Plugin"]);
|
||||
|
||||
/**
|
||||
* Default settings for plugin
|
||||
*/
|
||||
|
||||
|
||||
Magellan.defaults = {
|
||||
/**
|
||||
* Amount of time, in ms, the animated scrolling should take between locations.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 500
|
||||
*/
|
||||
animationDuration: 500,
|
||||
/**
|
||||
* Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'linear'
|
||||
* @see {@link https://api.jquery.com/animate|Jquery animate}
|
||||
*/
|
||||
animationEasing: 'linear',
|
||||
/**
|
||||
* Number of pixels to use as a marker for location changes.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 50
|
||||
*/
|
||||
threshold: 50,
|
||||
/**
|
||||
* Class applied to the active locations link on the magellan container.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'is-active'
|
||||
*/
|
||||
activeClass: 'is-active',
|
||||
/**
|
||||
* Allows the script to manipulate the url of the current page, and if supported, alter the history.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
deepLinking: false,
|
||||
/**
|
||||
* Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 0
|
||||
*/
|
||||
offset: 0
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 76:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {SmoothScroll: window.Foundation.SmoothScroll};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 87:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(21);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,767 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 89);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 10:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {onImagesLoaded: window.Foundation.onImagesLoaded};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 12:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Touch: window.Foundation.Touch};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 23:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_orbit__ = __webpack_require__(53);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_orbit__["a" /* Orbit */], 'Orbit');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Motion: window.Foundation.Motion, Move: window.Foundation.Move};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Keyboard: window.Foundation.Keyboard};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 53:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Orbit; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(5);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__ = __webpack_require__(4);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_timer__ = __webpack_require__(78);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_timer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_util_timer__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_imageLoader__ = __webpack_require__(10);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_util_imageLoader___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_util_imageLoader__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__foundation_plugin__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__foundation_util_touch__ = __webpack_require__(12);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__foundation_util_touch___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__foundation_util_touch__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Orbit module.
|
||||
* @module foundation.orbit
|
||||
* @requires foundation.util.keyboard
|
||||
* @requires foundation.util.motion
|
||||
* @requires foundation.util.timer
|
||||
* @requires foundation.util.imageLoader
|
||||
* @requires foundation.util.touch
|
||||
*/
|
||||
|
||||
var Orbit = function (_Plugin) {
|
||||
_inherits(Orbit, _Plugin);
|
||||
|
||||
function Orbit() {
|
||||
_classCallCheck(this, Orbit);
|
||||
|
||||
return _possibleConstructorReturn(this, (Orbit.__proto__ || Object.getPrototypeOf(Orbit)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Orbit, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of an orbit carousel.
|
||||
* @class
|
||||
* @name Orbit
|
||||
* @param {jQuery} element - jQuery object to make into an Orbit Carousel.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Orbit.defaults, this.$element.data(), options);
|
||||
this.className = 'Orbit'; // ie9 back compat
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_7__foundation_util_touch__["Touch"].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); // Touch init is idempotent, we just need to make sure it's initialied.
|
||||
|
||||
this._init();
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('Orbit', {
|
||||
'ltr': {
|
||||
'ARROW_RIGHT': 'next',
|
||||
'ARROW_LEFT': 'previous'
|
||||
},
|
||||
'rtl': {
|
||||
'ARROW_LEFT': 'next',
|
||||
'ARROW_RIGHT': 'previous'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
// @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide
|
||||
this._reset();
|
||||
|
||||
this.$wrapper = this.$element.find('.' + this.options.containerClass);
|
||||
this.$slides = this.$element.find('.' + this.options.slideClass);
|
||||
|
||||
var $images = this.$element.find('img'),
|
||||
initActive = this.$slides.filter('.is-active'),
|
||||
id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__foundation_util_core__["GetYoDigits"])(6, 'orbit');
|
||||
|
||||
this.$element.attr({
|
||||
'data-resize': id,
|
||||
'id': id
|
||||
});
|
||||
|
||||
if (!initActive.length) {
|
||||
this.$slides.eq(0).addClass('is-active');
|
||||
}
|
||||
|
||||
if (!this.options.useMUI) {
|
||||
this.$slides.addClass('no-motionui');
|
||||
}
|
||||
|
||||
if ($images.length) {
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__foundation_util_imageLoader__["onImagesLoaded"])($images, this._prepareForOrbit.bind(this));
|
||||
} else {
|
||||
this._prepareForOrbit(); //hehe
|
||||
}
|
||||
|
||||
if (this.options.bullets) {
|
||||
this._loadBullets();
|
||||
}
|
||||
|
||||
this._events();
|
||||
|
||||
if (this.options.autoPlay && this.$slides.length > 1) {
|
||||
this.geoSync();
|
||||
}
|
||||
|
||||
if (this.options.accessible) {
|
||||
// allow wrapper to be focusable to enable arrow navigation
|
||||
this.$wrapper.attr('tabindex', 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a jQuery collection of bullets, if they are being used.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_loadBullets',
|
||||
value: function _loadBullets() {
|
||||
this.$bullets = this.$element.find('.' + this.options.boxOfBullets).find('button');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a `timer` object on the orbit, and starts the counter for the next slide.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'geoSync',
|
||||
value: function geoSync() {
|
||||
var _this = this;
|
||||
this.timer = new __WEBPACK_IMPORTED_MODULE_3__foundation_util_timer__["Timer"](this.$element, {
|
||||
duration: this.options.timerDelay,
|
||||
infinite: false
|
||||
}, function () {
|
||||
_this.changeSlide(true);
|
||||
});
|
||||
this.timer.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets wrapper and slide heights for the orbit.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_prepareForOrbit',
|
||||
value: function _prepareForOrbit() {
|
||||
var _this = this;
|
||||
this._setWrapperHeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height.
|
||||
* @function
|
||||
* @private
|
||||
* @param {Function} cb - a callback function to fire when complete.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_setWrapperHeight',
|
||||
value: function _setWrapperHeight(cb) {
|
||||
//rewrite this to `for` loop
|
||||
var max = 0,
|
||||
temp,
|
||||
counter = 0,
|
||||
_this = this;
|
||||
|
||||
this.$slides.each(function () {
|
||||
temp = this.getBoundingClientRect().height;
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).attr('data-slide', counter);
|
||||
|
||||
if (!/mui/g.test(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {
|
||||
//if not the active slide, set css position and display property
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).css({ 'position': 'relative', 'display': 'none' });
|
||||
}
|
||||
max = temp > max ? temp : max;
|
||||
counter++;
|
||||
});
|
||||
|
||||
if (counter === this.$slides.length) {
|
||||
this.$wrapper.css({ 'height': max }); //only change the wrapper height property once.
|
||||
if (cb) {
|
||||
cb(max);
|
||||
} //fire callback with max height dimension.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the max-height of each slide.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_setSlideHeight',
|
||||
value: function _setSlideHeight(height) {
|
||||
this.$slides.each(function () {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).css('max-height', height);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event listeners to basically everything within the element.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this;
|
||||
|
||||
//***************************************
|
||||
//**Now using custom event - thanks to:**
|
||||
//** Yohai Ararat of Toronto **
|
||||
//***************************************
|
||||
//
|
||||
this.$element.off('.resizeme.zf.trigger').on({
|
||||
'resizeme.zf.trigger': this._prepareForOrbit.bind(this)
|
||||
});
|
||||
if (this.$slides.length > 1) {
|
||||
|
||||
if (this.options.swipe) {
|
||||
this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) {
|
||||
e.preventDefault();
|
||||
_this.changeSlide(true);
|
||||
}).on('swiperight.zf.orbit', function (e) {
|
||||
e.preventDefault();
|
||||
_this.changeSlide(false);
|
||||
});
|
||||
}
|
||||
//***************************************
|
||||
|
||||
if (this.options.autoPlay) {
|
||||
this.$slides.on('click.zf.orbit', function () {
|
||||
_this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true);
|
||||
_this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start']();
|
||||
});
|
||||
|
||||
if (this.options.pauseOnHover) {
|
||||
this.$element.on('mouseenter.zf.orbit', function () {
|
||||
_this.timer.pause();
|
||||
}).on('mouseleave.zf.orbit', function () {
|
||||
if (!_this.$element.data('clickedOn')) {
|
||||
_this.timer.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.navButtons) {
|
||||
var $controls = this.$element.find('.' + this.options.nextClass + ', .' + this.options.prevClass);
|
||||
$controls.attr('tabindex', 0)
|
||||
//also need to handle enter/return and spacebar key presses
|
||||
.on('click.zf.orbit touchend.zf.orbit', function (e) {
|
||||
e.preventDefault();
|
||||
_this.changeSlide(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).hasClass(_this.options.nextClass));
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.bullets) {
|
||||
this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () {
|
||||
if (/is-active/g.test(this.className)) {
|
||||
return false;
|
||||
} //if this is active, kick out of function.
|
||||
var idx = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('slide'),
|
||||
ltr = idx > _this.$slides.filter('.is-active').data('slide'),
|
||||
$slide = _this.$slides.eq(idx);
|
||||
|
||||
_this.changeSlide(ltr, $slide, idx);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.accessible) {
|
||||
this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) {
|
||||
// handle keyboard event with keyboard util
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'Orbit', {
|
||||
next: function () {
|
||||
_this.changeSlide(true);
|
||||
},
|
||||
previous: function () {
|
||||
_this.changeSlide(false);
|
||||
},
|
||||
handled: function () {
|
||||
// if bullet is focused, make sure focus moves
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(e.target).is(_this.$bullets)) {
|
||||
_this.$bullets.filter('.is-active').focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets Orbit so it can be reinitialized
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_reset',
|
||||
value: function _reset() {
|
||||
// Don't do anything if there are no slides (first run)
|
||||
if (typeof this.$slides == 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.$slides.length > 1) {
|
||||
// Remove old events
|
||||
this.$element.off('.zf.orbit').find('*').off('.zf.orbit');
|
||||
|
||||
// Restart timer if autoPlay is enabled
|
||||
if (this.options.autoPlay) {
|
||||
this.timer.restart();
|
||||
}
|
||||
|
||||
// Reset all sliddes
|
||||
this.$slides.each(function (el) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide();
|
||||
});
|
||||
|
||||
// Show the first slide
|
||||
this.$slides.first().addClass('is-active').show();
|
||||
|
||||
// Triggers when the slide has finished animating
|
||||
this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]);
|
||||
|
||||
// Select first bullet if bullets are present
|
||||
if (this.options.bullets) {
|
||||
this._updateBullets(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the current slide to a new one.
|
||||
* @function
|
||||
* @param {Boolean} isLTR - flag if the slide should move left to right.
|
||||
* @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected.
|
||||
* @param {Number} idx - the index of the new slide in its collection, if one chosen.
|
||||
* @fires Orbit#slidechange
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'changeSlide',
|
||||
value: function changeSlide(isLTR, chosenSlide, idx) {
|
||||
if (!this.$slides) {
|
||||
return;
|
||||
} // Don't freak out if we're in the middle of cleanup
|
||||
var $curSlide = this.$slides.filter('.is-active').eq(0);
|
||||
|
||||
if (/mui/g.test($curSlide[0].className)) {
|
||||
return false;
|
||||
} //if the slide is currently animating, kick out of the function
|
||||
|
||||
var $firstSlide = this.$slides.first(),
|
||||
$lastSlide = this.$slides.last(),
|
||||
dirIn = isLTR ? 'Right' : 'Left',
|
||||
dirOut = isLTR ? 'Left' : 'Right',
|
||||
_this = this,
|
||||
$newSlide;
|
||||
|
||||
if (!chosenSlide) {
|
||||
//most of the time, this will be auto played or clicked from the navButtons.
|
||||
$newSlide = isLTR ? //if wrapping enabled, check to see if there is a `next` or `prev` sibling, if not, select the first or last slide to fill in. if wrapping not enabled, attempt to select `next` or `prev`, if there's nothing there, the function will kick out on next step. CRAZY NESTED TERNARIES!!!!!
|
||||
this.options.infiniteWrap ? $curSlide.next('.' + this.options.slideClass).length ? $curSlide.next('.' + this.options.slideClass) : $firstSlide : $curSlide.next('.' + this.options.slideClass) : //pick next slide if moving left to right
|
||||
this.options.infiniteWrap ? $curSlide.prev('.' + this.options.slideClass).length ? $curSlide.prev('.' + this.options.slideClass) : $lastSlide : $curSlide.prev('.' + this.options.slideClass); //pick prev slide if moving right to left
|
||||
} else {
|
||||
$newSlide = chosenSlide;
|
||||
}
|
||||
|
||||
if ($newSlide.length) {
|
||||
/**
|
||||
* Triggers before the next slide starts animating in and only if a next slide has been found.
|
||||
* @event Orbit#beforeslidechange
|
||||
*/
|
||||
this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);
|
||||
|
||||
if (this.options.bullets) {
|
||||
idx = idx || this.$slides.index($newSlide); //grab index to update bullets
|
||||
this._updateBullets(idx);
|
||||
}
|
||||
|
||||
if (this.options.useMUI && !this.$element.is(':hidden')) {
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["Motion"].animateIn($newSlide.addClass('is-active').css({ 'position': 'absolute', 'top': 0 }), this.options['animInFrom' + dirIn], function () {
|
||||
$newSlide.css({ 'position': 'relative', 'display': 'block' }).attr('aria-live', 'polite');
|
||||
});
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["Motion"].animateOut($curSlide.removeClass('is-active'), this.options['animOutTo' + dirOut], function () {
|
||||
$curSlide.removeAttr('aria-live');
|
||||
if (_this.options.autoPlay && !_this.timer.isPaused) {
|
||||
_this.timer.restart();
|
||||
}
|
||||
//do stuff?
|
||||
});
|
||||
} else {
|
||||
$curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();
|
||||
$newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show();
|
||||
if (this.options.autoPlay && !this.timer.isPaused) {
|
||||
this.timer.restart();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Triggers when the slide has finished animating in.
|
||||
* @event Orbit#slidechange
|
||||
*/
|
||||
this.$element.trigger('slidechange.zf.orbit', [$newSlide]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the active state of the bullets, if displayed.
|
||||
* @function
|
||||
* @private
|
||||
* @param {Number} idx - the index of the current slide.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_updateBullets',
|
||||
value: function _updateBullets(idx) {
|
||||
var $oldBullet = this.$element.find('.' + this.options.boxOfBullets).find('.is-active').removeClass('is-active').blur(),
|
||||
span = $oldBullet.find('span:last').detach(),
|
||||
$newBullet = this.$bullets.eq(idx).addClass('is-active').append(span);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the carousel and hides the element.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();
|
||||
}
|
||||
}]);
|
||||
|
||||
return Orbit;
|
||||
}(__WEBPACK_IMPORTED_MODULE_6__foundation_plugin__["Plugin"]);
|
||||
|
||||
Orbit.defaults = {
|
||||
/**
|
||||
* Tells the JS to look for and loadBullets.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
bullets: true,
|
||||
/**
|
||||
* Tells the JS to apply event listeners to nav buttons
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
navButtons: true,
|
||||
/**
|
||||
* motion-ui animation class to apply
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'slide-in-right'
|
||||
*/
|
||||
animInFromRight: 'slide-in-right',
|
||||
/**
|
||||
* motion-ui animation class to apply
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'slide-out-right'
|
||||
*/
|
||||
animOutToRight: 'slide-out-right',
|
||||
/**
|
||||
* motion-ui animation class to apply
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'slide-in-left'
|
||||
*
|
||||
*/
|
||||
animInFromLeft: 'slide-in-left',
|
||||
/**
|
||||
* motion-ui animation class to apply
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'slide-out-left'
|
||||
*/
|
||||
animOutToLeft: 'slide-out-left',
|
||||
/**
|
||||
* Allows Orbit to automatically animate on page load.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
autoPlay: true,
|
||||
/**
|
||||
* Amount of time, in ms, between slide transitions
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 5000
|
||||
*/
|
||||
timerDelay: 5000,
|
||||
/**
|
||||
* Allows Orbit to infinitely loop through the slides
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
infiniteWrap: true,
|
||||
/**
|
||||
* Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
swipe: true,
|
||||
/**
|
||||
* Allows the timing function to pause animation on hover.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
pauseOnHover: true,
|
||||
/**
|
||||
* Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
accessible: true,
|
||||
/**
|
||||
* Class applied to the container of Orbit
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'orbit-container'
|
||||
*/
|
||||
containerClass: 'orbit-container',
|
||||
/**
|
||||
* Class applied to individual slides.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'orbit-slide'
|
||||
*/
|
||||
slideClass: 'orbit-slide',
|
||||
/**
|
||||
* Class applied to the bullet container. You're welcome.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'orbit-bullets'
|
||||
*/
|
||||
boxOfBullets: 'orbit-bullets',
|
||||
/**
|
||||
* Class applied to the `next` navigation button.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'orbit-next'
|
||||
*/
|
||||
nextClass: 'orbit-next',
|
||||
/**
|
||||
* Class applied to the `previous` navigation button.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'orbit-previous'
|
||||
*/
|
||||
prevClass: 'orbit-previous',
|
||||
/**
|
||||
* Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatability.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
useMUI: true
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 78:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Timer: window.Foundation.Timer};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 89:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(23);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
440
static/scss/foundation/dist/js/plugins/foundation.responsiveAccordionTabs.js
vendored
Normal file
440
static/scss/foundation/dist/js/plugins/foundation.responsiveAccordionTabs.js
vendored
Normal file
|
@ -0,0 +1,440 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 90);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 24:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_responsiveAccordionTabs__ = __webpack_require__(54);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_responsiveAccordionTabs__["a" /* ResponsiveAccordionTabs */], 'ResponsiveAccordionTabs');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 54:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponsiveAccordionTabs; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(6);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_accordion__ = __webpack_require__(72);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_accordion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_accordion__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_tabs__ = __webpack_require__(77);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_tabs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__foundation_tabs__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// The plugin matches the plugin classes with these plugin instances.
|
||||
var MenuPlugins = {
|
||||
tabs: {
|
||||
cssClass: 'tabs',
|
||||
plugin: __WEBPACK_IMPORTED_MODULE_5__foundation_tabs__["Tabs"]
|
||||
},
|
||||
accordion: {
|
||||
cssClass: 'accordion',
|
||||
plugin: __WEBPACK_IMPORTED_MODULE_4__foundation_accordion__["Accordion"]
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ResponsiveAccordionTabs module.
|
||||
* @module foundation.responsiveAccordionTabs
|
||||
* @requires foundation.util.motion
|
||||
* @requires foundation.accordion
|
||||
* @requires foundation.tabs
|
||||
*/
|
||||
|
||||
var ResponsiveAccordionTabs = function (_Plugin) {
|
||||
_inherits(ResponsiveAccordionTabs, _Plugin);
|
||||
|
||||
function ResponsiveAccordionTabs() {
|
||||
_classCallCheck(this, ResponsiveAccordionTabs);
|
||||
|
||||
return _possibleConstructorReturn(this, (ResponsiveAccordionTabs.__proto__ || Object.getPrototypeOf(ResponsiveAccordionTabs)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(ResponsiveAccordionTabs, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of a responsive accordion tabs.
|
||||
* @class
|
||||
* @name ResponsiveAccordionTabs
|
||||
* @fires ResponsiveAccordionTabs#init
|
||||
* @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(element);
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, this.$element.data(), options);
|
||||
this.rules = this.$element.data('responsive-accordion-tabs');
|
||||
this.currentMq = null;
|
||||
this.currentPlugin = null;
|
||||
this.className = 'ResponsiveAccordionTabs'; // ie9 back compat
|
||||
if (!this.$element.attr('id')) {
|
||||
this.$element.attr('id', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["GetYoDigits"])(6, 'responsiveaccordiontabs'));
|
||||
};
|
||||
|
||||
this._init();
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"]._init();
|
||||
|
||||
// The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
|
||||
if (typeof this.rules === 'string') {
|
||||
var rulesTree = {};
|
||||
|
||||
// Parse rules from "classes" pulled from data attribute
|
||||
var rules = this.rules.split(' ');
|
||||
|
||||
// Iterate through every rule found
|
||||
for (var i = 0; i < rules.length; i++) {
|
||||
var rule = rules[i].split('-');
|
||||
var ruleSize = rule.length > 1 ? rule[0] : 'small';
|
||||
var rulePlugin = rule.length > 1 ? rule[1] : rule[0];
|
||||
|
||||
if (MenuPlugins[rulePlugin] !== null) {
|
||||
rulesTree[ruleSize] = MenuPlugins[rulePlugin];
|
||||
}
|
||||
}
|
||||
|
||||
this.rules = rulesTree;
|
||||
}
|
||||
|
||||
this._getAllOptions();
|
||||
|
||||
if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.isEmptyObject(this.rules)) {
|
||||
this._checkMediaQueries();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: '_getAllOptions',
|
||||
value: function _getAllOptions() {
|
||||
//get all defaults and options
|
||||
var _this = this;
|
||||
_this.allOptions = {};
|
||||
for (var key in MenuPlugins) {
|
||||
if (MenuPlugins.hasOwnProperty(key)) {
|
||||
var obj = MenuPlugins[key];
|
||||
try {
|
||||
var dummyPlugin = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<ul></ul>');
|
||||
var tmpPlugin = new obj.plugin(dummyPlugin, _this.options);
|
||||
for (var keyKey in tmpPlugin.options) {
|
||||
if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') {
|
||||
var objObj = tmpPlugin.options[keyKey];
|
||||
_this.allOptions[keyKey] = objObj;
|
||||
}
|
||||
}
|
||||
tmpPlugin.destroy();
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes events for the Menu.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this;
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', function () {
|
||||
_this._checkMediaQueries();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_checkMediaQueries',
|
||||
value: function _checkMediaQueries() {
|
||||
var matchedMq,
|
||||
_this = this;
|
||||
// Iterate through each rule and find the last matching rule
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(this.rules, function (key) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"].atLeast(key)) {
|
||||
matchedMq = key;
|
||||
}
|
||||
});
|
||||
|
||||
// No match? No dice
|
||||
if (!matchedMq) return;
|
||||
|
||||
// Plugin already initialized? We good
|
||||
if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;
|
||||
|
||||
// Remove existing plugin-specific CSS classes
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(MenuPlugins, function (key, value) {
|
||||
_this.$element.removeClass(value.cssClass);
|
||||
});
|
||||
|
||||
// Add the CSS class for the new plugin
|
||||
this.$element.addClass(this.rules[matchedMq].cssClass);
|
||||
|
||||
// Create an instance of the new plugin
|
||||
if (this.currentPlugin) {
|
||||
//don't know why but on nested elements data zfPlugin get's lost
|
||||
if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin', this.storezfData);
|
||||
this.currentPlugin.destroy();
|
||||
}
|
||||
this._handleMarkup(this.rules[matchedMq].cssClass);
|
||||
this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});
|
||||
this.storezfData = this.currentPlugin.$element.data('zfPlugin');
|
||||
}
|
||||
}, {
|
||||
key: '_handleMarkup',
|
||||
value: function _handleMarkup(toSet) {
|
||||
var _this = this,
|
||||
fromString = 'accordion';
|
||||
var $panels = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-tabs-content=' + this.$element.attr('id') + ']');
|
||||
if ($panels.length) fromString = 'tabs';
|
||||
if (fromString === toSet) {
|
||||
return;
|
||||
};
|
||||
|
||||
var tabsTitle = _this.allOptions.linkClass ? _this.allOptions.linkClass : 'tabs-title';
|
||||
var tabsPanel = _this.allOptions.panelClass ? _this.allOptions.panelClass : 'tabs-panel';
|
||||
|
||||
this.$element.removeAttr('role');
|
||||
var $liHeads = this.$element.children('.' + tabsTitle + ',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item');
|
||||
var $liHeadsA = $liHeads.children('a').removeClass('accordion-title');
|
||||
|
||||
if (fromString === 'tabs') {
|
||||
$panels = $panels.children('.' + tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby');
|
||||
$panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected');
|
||||
} else {
|
||||
$panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content');
|
||||
};
|
||||
|
||||
$panels.css({ display: '', visibility: '' });
|
||||
$liHeads.css({ display: '', visibility: '' });
|
||||
if (toSet === 'accordion') {
|
||||
$panels.each(function (key, value) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content', '').removeClass('is-active').css({ height: '' });
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-tabs-content=' + _this.$element.attr('id') + ']').after('<div id="tabs-placeholder-' + _this.$element.attr('id') + '"></div>').detach();
|
||||
$liHeads.addClass('accordion-item').attr('data-accordion-item', '');
|
||||
$liHeadsA.addClass('accordion-title');
|
||||
});
|
||||
} else if (toSet === 'tabs') {
|
||||
var $tabsContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-tabs-content=' + _this.$element.attr('id') + ']');
|
||||
var $placeholder = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#tabs-placeholder-' + _this.$element.attr('id'));
|
||||
if ($placeholder.length) {
|
||||
$tabsContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<div class="tabs-content"></div>').insertAfter($placeholder).attr('data-tabs-content', _this.$element.attr('id'));
|
||||
$placeholder.remove();
|
||||
} else {
|
||||
$tabsContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content', _this.$element.attr('id'));
|
||||
};
|
||||
$panels.each(function (key, value) {
|
||||
var tempValue = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).appendTo($tabsContent).addClass(tabsPanel);
|
||||
var hash = $liHeadsA.get(key).hash.slice(1);
|
||||
var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).attr('id') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["GetYoDigits"])(6, 'accordion');
|
||||
if (hash !== id) {
|
||||
if (hash !== '') {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).attr('id', hash);
|
||||
} else {
|
||||
hash = id;
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(value).attr('id', hash);
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()($liHeadsA.get(key)).attr('href', __WEBPACK_IMPORTED_MODULE_0_jquery___default()($liHeadsA.get(key)).attr('href').replace('#', '') + '#' + hash);
|
||||
};
|
||||
};
|
||||
var isActive = __WEBPACK_IMPORTED_MODULE_0_jquery___default()($liHeads.get(key)).hasClass('is-active');
|
||||
if (isActive) {
|
||||
tempValue.addClass('is-active');
|
||||
};
|
||||
});
|
||||
$liHeads.addClass(tabsTitle);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
if (this.currentPlugin) this.currentPlugin.destroy();
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('.zf.ResponsiveAccordionTabs');
|
||||
}
|
||||
}]);
|
||||
|
||||
return ResponsiveAccordionTabs;
|
||||
}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["Plugin"]);
|
||||
|
||||
ResponsiveAccordionTabs.defaults = {};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {MediaQuery: window.Foundation.MediaQuery};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 72:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Accordion: window.Foundation.Accordion};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 77:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Tabs: window.Foundation.Tabs};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 90:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(24);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
1
static/scss/foundation/dist/js/plugins/foundation.responsiveAccordionTabs.min.js
vendored
Normal file
1
static/scss/foundation/dist/js/plugins/foundation.responsiveAccordionTabs.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,362 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 91);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 25:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_responsiveMenu__ = __webpack_require__(55);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_responsiveMenu__["a" /* ResponsiveMenu */], 'ResponsiveMenu');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 55:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponsiveMenu; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(6);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_dropdownMenu__ = __webpack_require__(75);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation_dropdownMenu___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__foundation_dropdownMenu__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_drilldown__ = __webpack_require__(74);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation_drilldown___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__foundation_drilldown__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation_accordionMenu__ = __webpack_require__(73);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation_accordionMenu___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__foundation_accordionMenu__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var MenuPlugins = {
|
||||
dropdown: {
|
||||
cssClass: 'dropdown',
|
||||
plugin: __WEBPACK_IMPORTED_MODULE_4__foundation_dropdownMenu__["DropdownMenu"]
|
||||
},
|
||||
drilldown: {
|
||||
cssClass: 'drilldown',
|
||||
plugin: __WEBPACK_IMPORTED_MODULE_5__foundation_drilldown__["Drilldown"]
|
||||
},
|
||||
accordion: {
|
||||
cssClass: 'accordion-menu',
|
||||
plugin: __WEBPACK_IMPORTED_MODULE_6__foundation_accordionMenu__["AccordionMenu"]
|
||||
}
|
||||
};
|
||||
|
||||
// import "foundation.util.triggers.js";
|
||||
|
||||
|
||||
/**
|
||||
* ResponsiveMenu module.
|
||||
* @module foundation.responsiveMenu
|
||||
* @requires foundation.util.triggers
|
||||
* @requires foundation.util.mediaQuery
|
||||
*/
|
||||
|
||||
var ResponsiveMenu = function (_Plugin) {
|
||||
_inherits(ResponsiveMenu, _Plugin);
|
||||
|
||||
function ResponsiveMenu() {
|
||||
_classCallCheck(this, ResponsiveMenu);
|
||||
|
||||
return _possibleConstructorReturn(this, (ResponsiveMenu.__proto__ || Object.getPrototypeOf(ResponsiveMenu)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(ResponsiveMenu, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of a responsive menu.
|
||||
* @class
|
||||
* @name ResponsiveMenu
|
||||
* @fires ResponsiveMenu#init
|
||||
* @param {jQuery} element - jQuery object to make into a dropdown menu.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(element);
|
||||
this.rules = this.$element.data('responsive-menu');
|
||||
this.currentMq = null;
|
||||
this.currentPlugin = null;
|
||||
this.className = 'ResponsiveMenu'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"]._init();
|
||||
// The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
|
||||
if (typeof this.rules === 'string') {
|
||||
var rulesTree = {};
|
||||
|
||||
// Parse rules from "classes" pulled from data attribute
|
||||
var rules = this.rules.split(' ');
|
||||
|
||||
// Iterate through every rule found
|
||||
for (var i = 0; i < rules.length; i++) {
|
||||
var rule = rules[i].split('-');
|
||||
var ruleSize = rule.length > 1 ? rule[0] : 'small';
|
||||
var rulePlugin = rule.length > 1 ? rule[1] : rule[0];
|
||||
|
||||
if (MenuPlugins[rulePlugin] !== null) {
|
||||
rulesTree[ruleSize] = MenuPlugins[rulePlugin];
|
||||
}
|
||||
}
|
||||
|
||||
this.rules = rulesTree;
|
||||
}
|
||||
|
||||
if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.isEmptyObject(this.rules)) {
|
||||
this._checkMediaQueries();
|
||||
}
|
||||
// Add data-mutate since children may need it.
|
||||
this.$element.attr('data-mutate', this.$element.attr('data-mutate') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_core__["GetYoDigits"])(6, 'responsive-menu'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes events for the Menu.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this;
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', function () {
|
||||
_this._checkMediaQueries();
|
||||
});
|
||||
// $(window).on('resize.zf.ResponsiveMenu', function() {
|
||||
// _this._checkMediaQueries();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_checkMediaQueries',
|
||||
value: function _checkMediaQueries() {
|
||||
var matchedMq,
|
||||
_this = this;
|
||||
// Iterate through each rule and find the last matching rule
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(this.rules, function (key) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"].atLeast(key)) {
|
||||
matchedMq = key;
|
||||
}
|
||||
});
|
||||
|
||||
// No match? No dice
|
||||
if (!matchedMq) return;
|
||||
|
||||
// Plugin already initialized? We good
|
||||
if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;
|
||||
|
||||
// Remove existing plugin-specific CSS classes
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(MenuPlugins, function (key, value) {
|
||||
_this.$element.removeClass(value.cssClass);
|
||||
});
|
||||
|
||||
// Add the CSS class for the new plugin
|
||||
this.$element.addClass(this.rules[matchedMq].cssClass);
|
||||
|
||||
// Create an instance of the new plugin
|
||||
if (this.currentPlugin) this.currentPlugin.destroy();
|
||||
this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.currentPlugin.destroy();
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('.zf.ResponsiveMenu');
|
||||
}
|
||||
}]);
|
||||
|
||||
return ResponsiveMenu;
|
||||
}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["Plugin"]);
|
||||
|
||||
ResponsiveMenu.defaults = {};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {MediaQuery: window.Foundation.MediaQuery};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 73:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {AccordionMenu: window.Foundation.AccordionMenu};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 74:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Drilldown: window.Foundation.Drilldown};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 75:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {DropdownMenu: window.Foundation.DropdownMenu};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 91:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(25);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
|
@ -0,0 +1 @@
|
|||
!function(n){function e(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var t={};e.m=n,e.c=t,e.i=function(n){return n},e.d=function(n,t,i){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="",e(e.s=91)}({0:function(n,e){n.exports=jQuery},1:function(n,e){n.exports={Foundation:window.Foundation}},2:function(n,e){n.exports={Plugin:window.Foundation.Plugin}},25:function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t(1),o=(t.n(i),t(55));i.Foundation.plugin(o.a,"ResponsiveMenu")},3:function(n,e){n.exports={rtl:window.Foundation.rtl,GetYoDigits:window.Foundation.GetYoDigits,transitionend:window.Foundation.transitionend}},55:function(n,e,t){"use strict";function i(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function o(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?n:e}function r(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}t.d(e,"a",function(){return y});var u=t(0),s=t.n(u),a=t(6),l=(t.n(a),t(3)),c=(t.n(l),t(2)),d=(t.n(c),t(75)),f=(t.n(d),t(74)),p=(t.n(f),t(73)),h=(t.n(p),function(){function n(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}return function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}}()),w={dropdown:{cssClass:"dropdown",plugin:d.DropdownMenu},drilldown:{cssClass:"drilldown",plugin:f.Drilldown},accordion:{cssClass:"accordion-menu",plugin:p.AccordionMenu}},y=function(n){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return r(e,n),h(e,[{key:"_setup",value:function(n,e){this.$element=s()(n),this.rules=this.$element.data("responsive-menu"),this.currentMq=null,this.currentPlugin=null,this.className="ResponsiveMenu",this._init(),this._events()}},{key:"_init",value:function(){if(a.MediaQuery._init(),"string"==typeof this.rules){for(var n={},e=this.rules.split(" "),i=0;i<e.length;i++){var o=e[i].split("-"),r=o.length>1?o[0]:"small",u=o.length>1?o[1]:o[0];null!==w[u]&&(n[r]=w[u])}this.rules=n}s.a.isEmptyObject(this.rules)||this._checkMediaQueries(),this.$element.attr("data-mutate",this.$element.attr("data-mutate")||t.i(l.GetYoDigits)(6,"responsive-menu"))}},{key:"_events",value:function(){var n=this;s()(window).on("changed.zf.mediaquery",function(){n._checkMediaQueries()})}},{key:"_checkMediaQueries",value:function(){var n,e=this;s.a.each(this.rules,function(e){a.MediaQuery.atLeast(e)&&(n=e)}),n&&(this.currentPlugin instanceof this.rules[n].plugin||(s.a.each(w,function(n,t){e.$element.removeClass(t.cssClass)}),this.$element.addClass(this.rules[n].cssClass),this.currentPlugin&&this.currentPlugin.destroy(),this.currentPlugin=new this.rules[n].plugin(this.$element,{})))}},{key:"_destroy",value:function(){this.currentPlugin.destroy(),s()(window).off(".zf.ResponsiveMenu")}}]),e}(c.Plugin);y.defaults={}},6:function(n,e){n.exports={MediaQuery:window.Foundation.MediaQuery}},73:function(n,e){n.exports={AccordionMenu:window.Foundation.AccordionMenu}},74:function(n,e){n.exports={Drilldown:window.Foundation.Drilldown}},75:function(n,e){n.exports={DropdownMenu:window.Foundation.DropdownMenu}},91:function(n,e,t){n.exports=t(25)}});
|
|
@ -0,0 +1,336 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 92);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 26:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_responsiveToggle__ = __webpack_require__(56);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_responsiveToggle__["a" /* ResponsiveToggle */], 'ResponsiveToggle');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Motion: window.Foundation.Motion, Move: window.Foundation.Move};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 56:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ResponsiveToggle; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__ = __webpack_require__(6);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__ = __webpack_require__(4);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_motion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ResponsiveToggle module.
|
||||
* @module foundation.responsiveToggle
|
||||
* @requires foundation.util.mediaQuery
|
||||
* @requires foundation.util.motion
|
||||
*/
|
||||
|
||||
var ResponsiveToggle = function (_Plugin) {
|
||||
_inherits(ResponsiveToggle, _Plugin);
|
||||
|
||||
function ResponsiveToggle() {
|
||||
_classCallCheck(this, ResponsiveToggle);
|
||||
|
||||
return _possibleConstructorReturn(this, (ResponsiveToggle.__proto__ || Object.getPrototypeOf(ResponsiveToggle)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(ResponsiveToggle, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of Tab Bar.
|
||||
* @class
|
||||
* @name ResponsiveToggle
|
||||
* @fires ResponsiveToggle#init
|
||||
* @param {jQuery} element - jQuery object to attach tab bar functionality to.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(element);
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, ResponsiveToggle.defaults, this.$element.data(), options);
|
||||
this.className = 'ResponsiveToggle'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the tab bar by finding the target element, toggling element, and running update().
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"]._init();
|
||||
var targetID = this.$element.data('responsive-toggle');
|
||||
if (!targetID) {
|
||||
console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');
|
||||
}
|
||||
|
||||
this.$targetMenu = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + targetID);
|
||||
this.$toggler = this.$element.find('[data-toggle]').filter(function () {
|
||||
var target = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle');
|
||||
return target === targetID || target === "";
|
||||
});
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, this.options, this.$targetMenu.data());
|
||||
|
||||
// If they were set, parse the animation classes
|
||||
if (this.options.animate) {
|
||||
var input = this.options.animate.split(' ');
|
||||
|
||||
this.animationIn = input[0];
|
||||
this.animationOut = input[1] || null;
|
||||
}
|
||||
|
||||
this._update();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds necessary event handlers for the tab bar to work.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this;
|
||||
|
||||
this._updateMqHandler = this._update.bind(this);
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', this._updateMqHandler);
|
||||
|
||||
this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the current media query to determine if the tab bar should be visible or hidden.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_update',
|
||||
value: function _update() {
|
||||
// Mobile
|
||||
if (!__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"].atLeast(this.options.hideFor)) {
|
||||
this.$element.show();
|
||||
this.$targetMenu.hide();
|
||||
}
|
||||
|
||||
// Desktop
|
||||
else {
|
||||
this.$element.hide();
|
||||
this.$targetMenu.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it.
|
||||
* @function
|
||||
* @fires ResponsiveToggle#toggled
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'toggleMenu',
|
||||
value: function toggleMenu() {
|
||||
var _this3 = this;
|
||||
|
||||
if (!__WEBPACK_IMPORTED_MODULE_1__foundation_util_mediaQuery__["MediaQuery"].atLeast(this.options.hideFor)) {
|
||||
/**
|
||||
* Fires when the element attached to the tab bar toggles.
|
||||
* @event ResponsiveToggle#toggled
|
||||
*/
|
||||
if (this.options.animate) {
|
||||
if (this.$targetMenu.is(':hidden')) {
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["Motion"].animateIn(this.$targetMenu, this.animationIn, function () {
|
||||
_this3.$element.trigger('toggled.zf.responsiveToggle');
|
||||
_this3.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');
|
||||
});
|
||||
} else {
|
||||
__WEBPACK_IMPORTED_MODULE_2__foundation_util_motion__["Motion"].animateOut(this.$targetMenu, this.animationOut, function () {
|
||||
_this3.$element.trigger('toggled.zf.responsiveToggle');
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$targetMenu.toggle(0);
|
||||
this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
||||
this.$element.trigger('toggled.zf.responsiveToggle');
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$element.off('.zf.responsiveToggle');
|
||||
this.$toggler.off('.zf.responsiveToggle');
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('changed.zf.mediaquery', this._updateMqHandler);
|
||||
}
|
||||
}]);
|
||||
|
||||
return ResponsiveToggle;
|
||||
}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["Plugin"]);
|
||||
|
||||
ResponsiveToggle.defaults = {
|
||||
/**
|
||||
* The breakpoint after which the menu is always shown, and the tab bar is hidden.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'medium'
|
||||
*/
|
||||
hideFor: 'medium',
|
||||
|
||||
/**
|
||||
* To decide if the toggle should be animated or not.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
animate: false
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {MediaQuery: window.Foundation.MediaQuery};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 92:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(26);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
|
@ -0,0 +1 @@
|
|||
!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=92)}({0:function(t,e){t.exports=jQuery},1:function(t,e){t.exports={Foundation:window.Foundation}},2:function(t,e){t.exports={Plugin:window.Foundation.Plugin}},26:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=(n.n(i),n(56));i.Foundation.plugin(o.a,"ResponsiveToggle")},4:function(t,e){t.exports={Motion:window.Foundation.Motion,Move:window.Foundation.Move}},56:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}n.d(e,"a",function(){return d});var a=n(0),u=n.n(a),s=n(6),l=(n.n(s),n(4)),f=(n.n(l),n(2)),g=(n.n(f),function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}()),d=function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return r(e,t),g(e,[{key:"_setup",value:function(t,n){this.$element=u()(t),this.options=u.a.extend({},e.defaults,this.$element.data(),n),this.className="ResponsiveToggle",this._init(),this._events()}},{key:"_init",value:function(){s.MediaQuery._init();var t=this.$element.data("responsive-toggle");if(t||console.error("Your tab bar needs an ID of a Menu as the value of data-tab-bar."),this.$targetMenu=u()("#"+t),this.$toggler=this.$element.find("[data-toggle]").filter(function(){var e=u()(this).data("toggle");return e===t||""===e}),this.options=u.a.extend({},this.options,this.$targetMenu.data()),this.options.animate){var e=this.options.animate.split(" ");this.animationIn=e[0],this.animationOut=e[1]||null}this._update()}},{key:"_events",value:function(){this._updateMqHandler=this._update.bind(this),u()(window).on("changed.zf.mediaquery",this._updateMqHandler),this.$toggler.on("click.zf.responsiveToggle",this.toggleMenu.bind(this))}},{key:"_update",value:function(){s.MediaQuery.atLeast(this.options.hideFor)?(this.$element.hide(),this.$targetMenu.show()):(this.$element.show(),this.$targetMenu.hide())}},{key:"toggleMenu",value:function(){var t=this;s.MediaQuery.atLeast(this.options.hideFor)||(this.options.animate?this.$targetMenu.is(":hidden")?l.Motion.animateIn(this.$targetMenu,this.animationIn,function(){t.$element.trigger("toggled.zf.responsiveToggle"),t.$targetMenu.find("[data-mutate]").triggerHandler("mutateme.zf.trigger")}):l.Motion.animateOut(this.$targetMenu,this.animationOut,function(){t.$element.trigger("toggled.zf.responsiveToggle")}):(this.$targetMenu.toggle(0),this.$targetMenu.find("[data-mutate]").trigger("mutateme.zf.trigger"),this.$element.trigger("toggled.zf.responsiveToggle")))}},{key:"_destroy",value:function(){this.$element.off(".zf.responsiveToggle"),this.$toggler.off(".zf.responsiveToggle"),u()(window).off("changed.zf.mediaquery",this._updateMqHandler)}}]),e}(f.Plugin);d.defaults={hideFor:"medium",animate:!1}},6:function(t,e){t.exports={MediaQuery:window.Foundation.MediaQuery}},92:function(t,e,n){t.exports=n(26)}});
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,303 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 95);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 29:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_smoothScroll__ = __webpack_require__(59);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_smoothScroll__["a" /* SmoothScroll */], 'SmoothScroll');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {rtl: window.Foundation.rtl, GetYoDigits: window.Foundation.GetYoDigits, transitionend: window.Foundation.transitionend};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 59:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SmoothScroll; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core__ = __webpack_require__(3);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* SmoothScroll module.
|
||||
* @module foundation.smooth-scroll
|
||||
*/
|
||||
|
||||
var SmoothScroll = function (_Plugin) {
|
||||
_inherits(SmoothScroll, _Plugin);
|
||||
|
||||
function SmoothScroll() {
|
||||
_classCallCheck(this, SmoothScroll);
|
||||
|
||||
return _possibleConstructorReturn(this, (SmoothScroll.__proto__ || Object.getPrototypeOf(SmoothScroll)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(SmoothScroll, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of SmoothScroll.
|
||||
* @class
|
||||
* @name SmoothScroll
|
||||
* @fires SmoothScroll#init
|
||||
* @param {Object} element - jQuery object to add the trigger to.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options);
|
||||
this.className = 'SmoothScroll'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the SmoothScroll plugin
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
var id = this.$element[0].id || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__foundation_util_core__["GetYoDigits"])(6, 'smooth-scroll');
|
||||
var _this = this;
|
||||
this.$element.attr({
|
||||
'id': id
|
||||
});
|
||||
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes events for SmoothScroll.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
var _this = this;
|
||||
|
||||
// click handler function.
|
||||
var handleLinkClick = function (e) {
|
||||
// exit function if the event source isn't coming from an anchor with href attribute starts with '#'
|
||||
if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is('a[href^="#"]')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var arrival = this.getAttribute('href');
|
||||
|
||||
_this._inTransition = true;
|
||||
|
||||
SmoothScroll.scrollToLoc(arrival, _this.options, function () {
|
||||
_this._inTransition = false;
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
this.$element.on('click.zf.smoothScroll', handleLinkClick);
|
||||
this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', handleLinkClick);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to scroll to a given location on the page.
|
||||
* @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'
|
||||
* @param {Object} options - The options to use.
|
||||
* @param {Function} callback - The callback function.
|
||||
* @static
|
||||
* @function
|
||||
*/
|
||||
|
||||
}], [{
|
||||
key: 'scrollToLoc',
|
||||
value: function scrollToLoc(loc) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults;
|
||||
var callback = arguments[2];
|
||||
|
||||
// Do nothing if target does not exist to prevent errors
|
||||
if (!__WEBPACK_IMPORTED_MODULE_0_jquery___default()(loc).length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var scrollPos = Math.round(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(loc).offset().top - options.threshold / 2 - options.offset);
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').stop(true).animate({ scrollTop: scrollPos }, options.animationDuration, options.animationEasing, function () {
|
||||
if (callback && typeof callback == "function") {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return SmoothScroll;
|
||||
}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["Plugin"]);
|
||||
|
||||
/**
|
||||
* Default settings for plugin.
|
||||
*/
|
||||
|
||||
|
||||
SmoothScroll.defaults = {
|
||||
/**
|
||||
* Amount of time, in ms, the animated scrolling should take between locations.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 500
|
||||
*/
|
||||
animationDuration: 500,
|
||||
/**
|
||||
* Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'linear'
|
||||
* @see {@link https://api.jquery.com/animate|Jquery animate}
|
||||
*/
|
||||
animationEasing: 'linear',
|
||||
/**
|
||||
* Number of pixels to use as a marker for location changes.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 50
|
||||
*/
|
||||
threshold: 50,
|
||||
/**
|
||||
* Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 0
|
||||
*/
|
||||
offset: 0
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 95:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(29);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
|
@ -0,0 +1 @@
|
|||
!function(t){function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var e={};n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=95)}({0:function(t,n){t.exports=jQuery},1:function(t,n){t.exports={Foundation:window.Foundation}},2:function(t,n){t.exports={Plugin:window.Foundation.Plugin}},29:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e(1),i=(e.n(o),e(59));o.Foundation.plugin(i.a,"SmoothScroll")},3:function(t,n){t.exports={rtl:window.Foundation.rtl,GetYoDigits:window.Foundation.GetYoDigits,transitionend:window.Foundation.transitionend}},59:function(t,n,e){"use strict";function o(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function r(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}e.d(n,"a",function(){return f});var u=e(0),a=e.n(u),s=e(3),l=(e.n(s),e(2)),c=(e.n(l),function(){function t(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(n,e,o){return e&&t(n.prototype,e),o&&t(n,o),n}}()),f=function(t){function n(){return o(this,n),i(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return r(n,t),c(n,[{key:"_setup",value:function(t,e){this.$element=t,this.options=a.a.extend({},n.defaults,this.$element.data(),e),this.className="SmoothScroll",this._init()}},{key:"_init",value:function(){var t=this.$element[0].id||e.i(s.GetYoDigits)(6,"smooth-scroll");this.$element.attr({id:t}),this._events()}},{key:"_events",value:function(){var t=this,e=function(e){if(!a()(this).is('a[href^="#"]'))return!1;var o=this.getAttribute("href");t._inTransition=!0,n.scrollToLoc(o,t.options,function(){t._inTransition=!1}),e.preventDefault()};this.$element.on("click.zf.smoothScroll",e),this.$element.on("click.zf.smoothScroll",'a[href^="#"]',e)}}],[{key:"scrollToLoc",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.defaults,o=arguments[2];if(!a()(t).length)return!1;var i=Math.round(a()(t).offset().top-e.threshold/2-e.offset);a()("html, body").stop(!0).animate({scrollTop:i},e.animationDuration,e.animationEasing,function(){o&&"function"==typeof o&&o()})}}]),n}(l.Plugin);f.defaults={animationDuration:500,animationEasing:"linear",threshold:50,offset:0}},95:function(t,n,e){t.exports=e(29)}});
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,678 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 97);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 10:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {onImagesLoaded: window.Foundation.onImagesLoaded};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 31:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_tabs__ = __webpack_require__(61);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_tabs__["a" /* Tabs */], 'Tabs');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Keyboard: window.Foundation.Keyboard};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 61:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Tabs; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__ = __webpack_require__(5);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__ = __webpack_require__(10);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tabs module.
|
||||
* @module foundation.tabs
|
||||
* @requires foundation.util.keyboard
|
||||
* @requires foundation.util.imageLoader if tabs contain images
|
||||
*/
|
||||
|
||||
var Tabs = function (_Plugin) {
|
||||
_inherits(Tabs, _Plugin);
|
||||
|
||||
function Tabs() {
|
||||
_classCallCheck(this, Tabs);
|
||||
|
||||
return _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Tabs, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of tabs.
|
||||
* @class
|
||||
* @name Tabs
|
||||
* @fires Tabs#init
|
||||
* @param {jQuery} element - jQuery object to make into tabs.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Tabs.defaults, this.$element.data(), options);
|
||||
this.className = 'Tabs'; // ie9 back compat
|
||||
|
||||
this._init();
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].register('Tabs', {
|
||||
'ENTER': 'open',
|
||||
'SPACE': 'open',
|
||||
'ARROW_RIGHT': 'next',
|
||||
'ARROW_UP': 'previous',
|
||||
'ARROW_DOWN': 'next',
|
||||
'ARROW_LEFT': 'previous'
|
||||
// 'TAB': 'next',
|
||||
// 'SHIFT_TAB': 'previous'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
var _this3 = this;
|
||||
|
||||
var _this = this;
|
||||
|
||||
this.$element.attr({ 'role': 'tablist' });
|
||||
this.$tabTitles = this.$element.find('.' + this.options.linkClass);
|
||||
this.$tabContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-tabs-content="' + this.$element[0].id + '"]');
|
||||
|
||||
this.$tabTitles.each(function () {
|
||||
var $elem = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
$link = $elem.find('a'),
|
||||
isActive = $elem.hasClass('' + _this.options.linkActiveClass),
|
||||
hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1),
|
||||
linkId = $link[0].id ? $link[0].id : hash + '-label',
|
||||
$tabContent = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + hash);
|
||||
|
||||
$elem.attr({ 'role': 'presentation' });
|
||||
|
||||
$link.attr({
|
||||
'role': 'tab',
|
||||
'aria-controls': hash,
|
||||
'aria-selected': isActive,
|
||||
'id': linkId,
|
||||
'tabindex': isActive ? '0' : '-1'
|
||||
});
|
||||
|
||||
$tabContent.attr({
|
||||
'role': 'tabpanel',
|
||||
'aria-labelledby': linkId
|
||||
});
|
||||
|
||||
if (!isActive) {
|
||||
$tabContent.attr('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
if (isActive && _this.options.autoFocus) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).load(function () {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, function () {
|
||||
$link.focus();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
if (this.options.matchHeight) {
|
||||
var $images = this.$tabContent.find('img');
|
||||
|
||||
if ($images.length) {
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__foundation_util_imageLoader__["onImagesLoaded"])($images, this._setHeight.bind(this));
|
||||
} else {
|
||||
this._setHeight();
|
||||
}
|
||||
}
|
||||
|
||||
//current context-bound function to open tabs on page load or history popstate
|
||||
this._checkDeepLink = function () {
|
||||
var anchor = window.location.hash;
|
||||
//need a hash and a relevant anchor in this tabset
|
||||
if (anchor.length) {
|
||||
var $link = _this3.$element.find('[href$="' + anchor + '"]');
|
||||
if ($link.length) {
|
||||
_this3.selectTab(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(anchor), true);
|
||||
|
||||
//roll up a little to show the titles
|
||||
if (_this3.options.deepLinkSmudge) {
|
||||
var offset = _this3.$element.offset();
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('html, body').animate({ scrollTop: offset.top }, _this3.options.deepLinkSmudgeDelay);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when the zplugin has deeplinked at pageload
|
||||
* @event Tabs#deeplink
|
||||
*/
|
||||
_this3.$element.trigger('deeplink.zf.tabs', [$link, __WEBPACK_IMPORTED_MODULE_0_jquery___default()(anchor)]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//use browser to open a tab, if it exists in this tabset
|
||||
if (this.options.deepLink) {
|
||||
this._checkDeepLink();
|
||||
}
|
||||
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event handlers for items within the tabs.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
this._addKeyHandler();
|
||||
this._addClickHandler();
|
||||
this._setHeightMqHandler = null;
|
||||
|
||||
if (this.options.matchHeight) {
|
||||
this._setHeightMqHandler = this._setHeight.bind(this);
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('changed.zf.mediaquery', this._setHeightMqHandler);
|
||||
}
|
||||
|
||||
if (this.options.deepLink) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('popstate', this._checkDeepLink);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds click handlers for items within the tabs.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_addClickHandler',
|
||||
value: function _addClickHandler() {
|
||||
var _this = this;
|
||||
|
||||
this.$element.off('click.zf.tabs').on('click.zf.tabs', '.' + this.options.linkClass, function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
_this._handleTabChange(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds keyboard event handlers for items within the tabs.
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_addKeyHandler',
|
||||
value: function _addKeyHandler() {
|
||||
var _this = this;
|
||||
|
||||
this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function (e) {
|
||||
if (e.which === 9) return;
|
||||
|
||||
var $element = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
$elements = $element.parent('ul').children('li'),
|
||||
$prevElement,
|
||||
$nextElement;
|
||||
|
||||
$elements.each(function (i) {
|
||||
if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).is($element)) {
|
||||
if (_this.options.wrapOnKeys) {
|
||||
$prevElement = i === 0 ? $elements.last() : $elements.eq(i - 1);
|
||||
$nextElement = i === $elements.length - 1 ? $elements.first() : $elements.eq(i + 1);
|
||||
} else {
|
||||
$prevElement = $elements.eq(Math.max(0, i - 1));
|
||||
$nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
// handle keyboard event with keyboard util
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_keyboard__["Keyboard"].handleKey(e, 'Tabs', {
|
||||
open: function () {
|
||||
$element.find('[role="tab"]').focus();
|
||||
_this._handleTabChange($element);
|
||||
},
|
||||
previous: function () {
|
||||
$prevElement.find('[role="tab"]').focus();
|
||||
_this._handleTabChange($prevElement);
|
||||
},
|
||||
next: function () {
|
||||
$nextElement.find('[role="tab"]').focus();
|
||||
_this._handleTabChange($nextElement);
|
||||
},
|
||||
handled: function () {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the tab `$targetContent` defined by `$target`. Collapses active tab.
|
||||
* @param {jQuery} $target - Tab to open.
|
||||
* @param {boolean} historyHandled - browser has already handled a history update
|
||||
* @fires Tabs#change
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_handleTabChange',
|
||||
value: function _handleTabChange($target, historyHandled) {
|
||||
|
||||
/**
|
||||
* Check for active class on target. Collapse if exists.
|
||||
*/
|
||||
if ($target.hasClass('' + this.options.linkActiveClass)) {
|
||||
if (this.options.activeCollapse) {
|
||||
this._collapseTab($target);
|
||||
|
||||
/**
|
||||
* Fires when the zplugin has successfully collapsed tabs.
|
||||
* @event Tabs#collapse
|
||||
*/
|
||||
this.$element.trigger('collapse.zf.tabs', [$target]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var $oldTab = this.$element.find('.' + this.options.linkClass + '.' + this.options.linkActiveClass),
|
||||
$tabLink = $target.find('[role="tab"]'),
|
||||
hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1),
|
||||
$targetContent = this.$tabContent.find('#' + hash);
|
||||
|
||||
//close old tab
|
||||
this._collapseTab($oldTab);
|
||||
|
||||
//open new tab
|
||||
this._openTab($target);
|
||||
|
||||
//either replace or update browser history
|
||||
if (this.options.deepLink && !historyHandled) {
|
||||
var anchor = $target.find('a').attr('href');
|
||||
|
||||
if (this.options.updateHistory) {
|
||||
history.pushState({}, '', anchor);
|
||||
} else {
|
||||
history.replaceState({}, '', anchor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when the plugin has successfully changed tabs.
|
||||
* @event Tabs#change
|
||||
*/
|
||||
this.$element.trigger('change.zf.tabs', [$target, $targetContent]);
|
||||
|
||||
//fire to children a mutation event
|
||||
$targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger");
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the tab `$targetContent` defined by `$target`.
|
||||
* @param {jQuery} $target - Tab to Open.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_openTab',
|
||||
value: function _openTab($target) {
|
||||
var $tabLink = $target.find('[role="tab"]'),
|
||||
hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1),
|
||||
$targetContent = this.$tabContent.find('#' + hash);
|
||||
|
||||
$target.addClass('' + this.options.linkActiveClass);
|
||||
|
||||
$tabLink.attr({
|
||||
'aria-selected': 'true',
|
||||
'tabindex': '0'
|
||||
});
|
||||
|
||||
$targetContent.addClass('' + this.options.panelActiveClass).removeAttr('aria-hidden');
|
||||
}
|
||||
|
||||
/**
|
||||
* Collapses `$targetContent` defined by `$target`.
|
||||
* @param {jQuery} $target - Tab to Open.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_collapseTab',
|
||||
value: function _collapseTab($target) {
|
||||
var $target_anchor = $target.removeClass('' + this.options.linkActiveClass).find('[role="tab"]').attr({
|
||||
'aria-selected': 'false',
|
||||
'tabindex': -1
|
||||
});
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + $target_anchor.attr('aria-controls')).removeClass('' + this.options.panelActiveClass).attr({ 'aria-hidden': 'true' });
|
||||
}
|
||||
|
||||
/**
|
||||
* Public method for selecting a content pane to display.
|
||||
* @param {jQuery | String} elem - jQuery object or string of the id of the pane to display.
|
||||
* @param {boolean} historyHandled - browser has already handled a history update
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'selectTab',
|
||||
value: function selectTab(elem, historyHandled) {
|
||||
var idStr;
|
||||
|
||||
if (typeof elem === 'object') {
|
||||
idStr = elem[0].id;
|
||||
} else {
|
||||
idStr = elem;
|
||||
}
|
||||
|
||||
if (idStr.indexOf('#') < 0) {
|
||||
idStr = '#' + idStr;
|
||||
}
|
||||
|
||||
var $target = this.$tabTitles.find('[href$="' + idStr + '"]').parent('.' + this.options.linkClass);
|
||||
|
||||
this._handleTabChange($target, historyHandled);
|
||||
}
|
||||
}, {
|
||||
key: '_setHeight',
|
||||
|
||||
/**
|
||||
* Sets the height of each panel to the height of the tallest panel.
|
||||
* If enabled in options, gets called on media query change.
|
||||
* If loading content via external source, can be called directly or with _reflow.
|
||||
* If enabled with `data-match-height="true"`, tabs sets to equal height
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
value: function _setHeight() {
|
||||
var max = 0,
|
||||
_this = this; // Lock down the `this` value for the root tabs object
|
||||
|
||||
this.$tabContent.find('.' + this.options.panelClass).css('height', '').each(function () {
|
||||
|
||||
var panel = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this),
|
||||
isActive = panel.hasClass('' + _this.options.panelActiveClass); // get the options from the parent instead of trying to get them from the child
|
||||
|
||||
if (!isActive) {
|
||||
panel.css({ 'visibility': 'hidden', 'display': 'block' });
|
||||
}
|
||||
|
||||
var temp = this.getBoundingClientRect().height;
|
||||
|
||||
if (!isActive) {
|
||||
panel.css({
|
||||
'visibility': '',
|
||||
'display': ''
|
||||
});
|
||||
}
|
||||
|
||||
max = temp > max ? temp : max;
|
||||
}).css('height', max + 'px');
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys an instance of an tabs.
|
||||
* @fires Tabs#destroyed
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$element.find('.' + this.options.linkClass).off('.zf.tabs').hide().end().find('.' + this.options.panelClass).hide();
|
||||
|
||||
if (this.options.matchHeight) {
|
||||
if (this._setHeightMqHandler != null) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.deepLink) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._checkDeepLink);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return Tabs;
|
||||
}(__WEBPACK_IMPORTED_MODULE_3__foundation_plugin__["Plugin"]);
|
||||
|
||||
Tabs.defaults = {
|
||||
/**
|
||||
* Allows the window to scroll to content of pane specified by hash anchor
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
deepLink: false,
|
||||
|
||||
/**
|
||||
* Adjust the deep link scroll to make sure the top of the tab panel is visible
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
deepLinkSmudge: false,
|
||||
|
||||
/**
|
||||
* Animation time (ms) for the deep link adjustment
|
||||
* @option
|
||||
* @type {number}
|
||||
* @default 300
|
||||
*/
|
||||
deepLinkSmudgeDelay: 300,
|
||||
|
||||
/**
|
||||
* Update the browser history with the open tab
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
updateHistory: false,
|
||||
|
||||
/**
|
||||
* Allows the window to scroll to content of active pane on load if set to true.
|
||||
* Not recommended if more than one tab panel per page.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
autoFocus: false,
|
||||
|
||||
/**
|
||||
* Allows keyboard input to 'wrap' around the tab links.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
wrapOnKeys: true,
|
||||
|
||||
/**
|
||||
* Allows the tab content panes to match heights if set to true.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
matchHeight: false,
|
||||
|
||||
/**
|
||||
* Allows active tabs to collapse when clicked.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
activeCollapse: false,
|
||||
|
||||
/**
|
||||
* Class applied to `li`'s in tab link list.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'tabs-title'
|
||||
*/
|
||||
linkClass: 'tabs-title',
|
||||
|
||||
/**
|
||||
* Class applied to the active `li` in tab link list.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'is-active'
|
||||
*/
|
||||
linkActiveClass: 'is-active',
|
||||
|
||||
/**
|
||||
* Class applied to the content containers.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'tabs-panel'
|
||||
*/
|
||||
panelClass: 'tabs-panel',
|
||||
|
||||
/**
|
||||
* Class applied to the active content container.
|
||||
* @option
|
||||
* @type {string}
|
||||
* @default 'is-active'
|
||||
*/
|
||||
panelActiveClass: 'is-active'
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 97:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(31);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,601 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // identity function for calling harmony imports with the correct context
|
||||
/******/ __webpack_require__.i = function(value) { return value; };
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 98);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 0:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = jQuery;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Foundation: window.Foundation};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Plugin: window.Foundation.Plugin};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 32:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__foundation_core__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_toggler__ = __webpack_require__(62);
|
||||
|
||||
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0__foundation_core__["Foundation"].plugin(__WEBPACK_IMPORTED_MODULE_1__foundation_toggler__["a" /* Toggler */], 'Toggler');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 4:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
module.exports = {Motion: window.Foundation.Motion, Move: window.Foundation.Move};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 62:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Toggler; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__ = __webpack_require__(4);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation_plugin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation_util_triggers__ = __webpack_require__(7);
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Toggler module.
|
||||
* @module foundation.toggler
|
||||
* @requires foundation.util.motion
|
||||
* @requires foundation.util.triggers
|
||||
*/
|
||||
|
||||
var Toggler = function (_Plugin) {
|
||||
_inherits(Toggler, _Plugin);
|
||||
|
||||
function Toggler() {
|
||||
_classCallCheck(this, Toggler);
|
||||
|
||||
return _possibleConstructorReturn(this, (Toggler.__proto__ || Object.getPrototypeOf(Toggler)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(Toggler, [{
|
||||
key: '_setup',
|
||||
|
||||
/**
|
||||
* Creates a new instance of Toggler.
|
||||
* @class
|
||||
* @name Toggler
|
||||
* @fires Toggler#init
|
||||
* @param {Object} element - jQuery object to add the trigger to.
|
||||
* @param {Object} options - Overrides to the default plugin settings.
|
||||
*/
|
||||
value: function _setup(element, options) {
|
||||
this.$element = element;
|
||||
this.options = __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.extend({}, Toggler.defaults, element.data(), options);
|
||||
this.className = '';
|
||||
this.className = 'Toggler'; // ie9 back compat
|
||||
|
||||
// Triggers init is idempotent, just need to make sure it is initialized
|
||||
__WEBPACK_IMPORTED_MODULE_3__foundation_util_triggers__["a" /* Triggers */].init(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a);
|
||||
|
||||
this._init();
|
||||
this._events();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_init',
|
||||
value: function _init() {
|
||||
var input;
|
||||
// Parse animation classes if they were set
|
||||
if (this.options.animate) {
|
||||
input = this.options.animate.split(' ');
|
||||
|
||||
this.animationIn = input[0];
|
||||
this.animationOut = input[1] || null;
|
||||
}
|
||||
// Otherwise, parse toggle class
|
||||
else {
|
||||
input = this.$element.data('toggler');
|
||||
// Allow for a . at the beginning of the string
|
||||
this.className = input[0] === '.' ? input.slice(1) : input;
|
||||
}
|
||||
|
||||
// Add ARIA attributes to triggers
|
||||
var id = this.$element[0].id;
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-open="' + id + '"], [data-close="' + id + '"], [data-toggle="' + id + '"]').attr('aria-controls', id);
|
||||
// If the target is hidden, add aria-hidden
|
||||
this.$element.attr('aria-expanded', this.$element.is(':hidden') ? false : true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes events for the toggle trigger.
|
||||
* @function
|
||||
* @private
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_events',
|
||||
value: function _events() {
|
||||
this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the target class on the target element. An event is fired from the original trigger depending on if the resultant state was "on" or "off".
|
||||
* @function
|
||||
* @fires Toggler#on
|
||||
* @fires Toggler#off
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'toggle',
|
||||
value: function toggle() {
|
||||
this[this.options.animate ? '_toggleAnimate' : '_toggleClass']();
|
||||
}
|
||||
}, {
|
||||
key: '_toggleClass',
|
||||
value: function _toggleClass() {
|
||||
this.$element.toggleClass(this.className);
|
||||
|
||||
var isOn = this.$element.hasClass(this.className);
|
||||
if (isOn) {
|
||||
/**
|
||||
* Fires if the target element has the class after a toggle.
|
||||
* @event Toggler#on
|
||||
*/
|
||||
this.$element.trigger('on.zf.toggler');
|
||||
} else {
|
||||
/**
|
||||
* Fires if the target element does not have the class after a toggle.
|
||||
* @event Toggler#off
|
||||
*/
|
||||
this.$element.trigger('off.zf.toggler');
|
||||
}
|
||||
|
||||
this._updateARIA(isOn);
|
||||
this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
||||
}
|
||||
}, {
|
||||
key: '_toggleAnimate',
|
||||
value: function _toggleAnimate() {
|
||||
var _this = this;
|
||||
|
||||
if (this.$element.is(':hidden')) {
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__["Motion"].animateIn(this.$element, this.animationIn, function () {
|
||||
_this._updateARIA(true);
|
||||
this.trigger('on.zf.toggler');
|
||||
this.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
||||
});
|
||||
} else {
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__["Motion"].animateOut(this.$element, this.animationOut, function () {
|
||||
_this._updateARIA(false);
|
||||
this.trigger('off.zf.toggler');
|
||||
this.find('[data-mutate]').trigger('mutateme.zf.trigger');
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: '_updateARIA',
|
||||
value: function _updateARIA(isOn) {
|
||||
this.$element.attr('aria-expanded', isOn ? true : false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the instance of Toggler on the element.
|
||||
* @function
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_destroy',
|
||||
value: function _destroy() {
|
||||
this.$element.off('.zf.toggler');
|
||||
}
|
||||
}]);
|
||||
|
||||
return Toggler;
|
||||
}(__WEBPACK_IMPORTED_MODULE_2__foundation_plugin__["Plugin"]);
|
||||
|
||||
Toggler.defaults = {
|
||||
/**
|
||||
* Tells the plugin if the element should animated when toggled.
|
||||
* @option
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
*/
|
||||
animate: false
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Triggers; });
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__ = __webpack_require__(4);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation_util_motion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var MutationObserver = function () {
|
||||
var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
|
||||
for (var i = 0; i < prefixes.length; i++) {
|
||||
if (prefixes[i] + 'MutationObserver' in window) {
|
||||
return window[prefixes[i] + 'MutationObserver'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
|
||||
var triggers = function (el, type) {
|
||||
el.data(type).split(' ').forEach(function (id) {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + id)[type === 'close' ? 'trigger' : 'triggerHandler'](type + '.zf.trigger', [el]);
|
||||
});
|
||||
};
|
||||
|
||||
var Triggers = {
|
||||
Listeners: {
|
||||
Basic: {},
|
||||
Global: {}
|
||||
},
|
||||
Initializers: {}
|
||||
};
|
||||
|
||||
Triggers.Listeners.Basic = {
|
||||
openListener: function () {
|
||||
triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'open');
|
||||
},
|
||||
closeListener: function () {
|
||||
var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('close');
|
||||
if (id) {
|
||||
triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'close');
|
||||
} else {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('close.zf.trigger');
|
||||
}
|
||||
},
|
||||
toggleListener: function () {
|
||||
var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle');
|
||||
if (id) {
|
||||
triggers(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), 'toggle');
|
||||
} else {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('toggle.zf.trigger');
|
||||
}
|
||||
},
|
||||
closeableListener: function (e) {
|
||||
e.stopPropagation();
|
||||
var animation = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('closable');
|
||||
|
||||
if (animation !== '') {
|
||||
__WEBPACK_IMPORTED_MODULE_1__foundation_util_motion__["Motion"].animateOut(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this), animation, function () {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).trigger('closed.zf');
|
||||
});
|
||||
} else {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).fadeOut().trigger('closed.zf');
|
||||
}
|
||||
},
|
||||
toggleFocusListener: function () {
|
||||
var id = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('toggle-focus');
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()('#' + id).triggerHandler('toggle.zf.trigger', [__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this)]);
|
||||
}
|
||||
};
|
||||
|
||||
// Elements with [data-open] will reveal a plugin that supports it when clicked.
|
||||
Triggers.Initializers.addOpenListener = function ($elem) {
|
||||
$elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);
|
||||
$elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);
|
||||
};
|
||||
|
||||
// Elements with [data-close] will close a plugin that supports it when clicked.
|
||||
// If used without a value on [data-close], the event will bubble, allowing it to close a parent component.
|
||||
Triggers.Initializers.addCloseListener = function ($elem) {
|
||||
$elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);
|
||||
$elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);
|
||||
};
|
||||
|
||||
// Elements with [data-toggle] will toggle a plugin that supports it when clicked.
|
||||
Triggers.Initializers.addToggleListener = function ($elem) {
|
||||
$elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);
|
||||
$elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);
|
||||
};
|
||||
|
||||
// Elements with [data-closable] will respond to close.zf.trigger events.
|
||||
Triggers.Initializers.addCloseableListener = function ($elem) {
|
||||
$elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);
|
||||
$elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);
|
||||
};
|
||||
|
||||
// Elements with [data-toggle-focus] will respond to coming in and out of focus
|
||||
Triggers.Initializers.addToggleFocusListener = function ($elem) {
|
||||
$elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);
|
||||
$elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);
|
||||
};
|
||||
|
||||
// More Global/complex listeners and triggers
|
||||
Triggers.Listeners.Global = {
|
||||
resizeListener: function ($nodes) {
|
||||
if (!MutationObserver) {
|
||||
//fallback for IE 9
|
||||
$nodes.each(function () {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).triggerHandler('resizeme.zf.trigger');
|
||||
});
|
||||
}
|
||||
//trigger all listening elements and signal a resize event
|
||||
$nodes.attr('data-events', "resize");
|
||||
},
|
||||
scrollListener: function ($nodes) {
|
||||
if (!MutationObserver) {
|
||||
//fallback for IE 9
|
||||
$nodes.each(function () {
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).triggerHandler('scrollme.zf.trigger');
|
||||
});
|
||||
}
|
||||
//trigger all listening elements and signal a scroll event
|
||||
$nodes.attr('data-events', "scroll");
|
||||
},
|
||||
closeMeListener: function (e, pluginId) {
|
||||
var plugin = e.namespace.split('.')[0];
|
||||
var plugins = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-' + plugin + ']').not('[data-yeti-box="' + pluginId + '"]');
|
||||
|
||||
plugins.each(function () {
|
||||
var _this = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);
|
||||
_this.triggerHandler('close.zf.trigger', [_this]);
|
||||
});
|
||||
}
|
||||
|
||||
// Global, parses whole document.
|
||||
};Triggers.Initializers.addClosemeListener = function (pluginName) {
|
||||
var yetiBoxes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-yeti-box]'),
|
||||
plugNames = ['dropdown', 'tooltip', 'reveal'];
|
||||
|
||||
if (pluginName) {
|
||||
if (typeof pluginName === 'string') {
|
||||
plugNames.push(pluginName);
|
||||
} else if (typeof pluginName === 'object' && typeof pluginName[0] === 'string') {
|
||||
plugNames.concat(pluginName);
|
||||
} else {
|
||||
console.error('Plugin names must be strings');
|
||||
}
|
||||
}
|
||||
if (yetiBoxes.length) {
|
||||
var listeners = plugNames.map(function (name) {
|
||||
return 'closeme.zf.' + name;
|
||||
}).join(' ');
|
||||
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);
|
||||
}
|
||||
};
|
||||
|
||||
function debounceGlobalListener(debounce, trigger, listener) {
|
||||
var timer = void 0,
|
||||
args = Array.prototype.slice.call(arguments, 3);
|
||||
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(trigger).on(trigger, function (e) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
timer = setTimeout(function () {
|
||||
listener.apply(null, args);
|
||||
}, debounce || 10); //default time to emit scroll event
|
||||
});
|
||||
}
|
||||
|
||||
Triggers.Initializers.addResizeListener = function (debounce) {
|
||||
var $nodes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-resize]');
|
||||
if ($nodes.length) {
|
||||
debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);
|
||||
}
|
||||
};
|
||||
|
||||
Triggers.Initializers.addScrollListener = function (debounce) {
|
||||
var $nodes = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('[data-scroll]');
|
||||
if ($nodes.length) {
|
||||
debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);
|
||||
}
|
||||
};
|
||||
|
||||
Triggers.Initializers.addMutationEventsListener = function ($elem) {
|
||||
if (!MutationObserver) {
|
||||
return false;
|
||||
}
|
||||
var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]');
|
||||
|
||||
//element callback
|
||||
var listeningElementsMutation = function (mutationRecordsList) {
|
||||
var $target = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(mutationRecordsList[0].target);
|
||||
|
||||
//trigger the event handler for the element depending on type
|
||||
switch (mutationRecordsList[0].type) {
|
||||
case "attributes":
|
||||
if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") {
|
||||
$target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);
|
||||
}
|
||||
if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") {
|
||||
$target.triggerHandler('resizeme.zf.trigger', [$target]);
|
||||
}
|
||||
if (mutationRecordsList[0].attributeName === "style") {
|
||||
$target.closest("[data-mutate]").attr("data-events", "mutate");
|
||||
$target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
|
||||
}
|
||||
break;
|
||||
|
||||
case "childList":
|
||||
$target.closest("[data-mutate]").attr("data-events", "mutate");
|
||||
$target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
//nothing
|
||||
}
|
||||
};
|
||||
|
||||
if ($nodes.length) {
|
||||
//for each element that needs to listen for resizing, scrolling, or mutation add a single observer
|
||||
for (var i = 0; i <= $nodes.length - 1; i++) {
|
||||
var elementObserver = new MutationObserver(listeningElementsMutation);
|
||||
elementObserver.observe($nodes[i], { attributes: true, childList: true, characterData: false, subtree: true, attributeFilter: ["data-events", "style"] });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Triggers.Initializers.addSimpleListeners = function () {
|
||||
var $document = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document);
|
||||
|
||||
Triggers.Initializers.addOpenListener($document);
|
||||
Triggers.Initializers.addCloseListener($document);
|
||||
Triggers.Initializers.addToggleListener($document);
|
||||
Triggers.Initializers.addCloseableListener($document);
|
||||
Triggers.Initializers.addToggleFocusListener($document);
|
||||
};
|
||||
|
||||
Triggers.Initializers.addGlobalListeners = function () {
|
||||
var $document = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document);
|
||||
Triggers.Initializers.addMutationEventsListener($document);
|
||||
Triggers.Initializers.addResizeListener();
|
||||
Triggers.Initializers.addScrollListener();
|
||||
Triggers.Initializers.addClosemeListener();
|
||||
};
|
||||
|
||||
Triggers.init = function ($, Foundation) {
|
||||
if (typeof $.triggersInitialized === 'undefined') {
|
||||
var $document = $(document);
|
||||
|
||||
if (document.readyState === "complete") {
|
||||
Triggers.Initializers.addSimpleListeners();
|
||||
Triggers.Initializers.addGlobalListeners();
|
||||
} else {
|
||||
$(window).on('load', function () {
|
||||
Triggers.Initializers.addSimpleListeners();
|
||||
Triggers.Initializers.addGlobalListeners();
|
||||
});
|
||||
}
|
||||
|
||||
$.triggersInitialized = true;
|
||||
}
|
||||
|
||||
if (Foundation) {
|
||||
Foundation.Triggers = Triggers;
|
||||
// Legacy included to be backwards compatible for now.
|
||||
Foundation.IHearYou = Triggers.Initializers.addGlobalListeners;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 98:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(32);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue