Skip to content
Snippets Groups Projects
Commit 1eda5aa7 authored by Ken Hawkins's avatar Ken Hawkins Committed by GitHub
Browse files

Merge pull request #104 from ebiwd/master

Trial auto-invocation of foundation, foundationextend for #77
parents 896234e0 5aa505a4
No related branches found
No related tags found
No related merge requests found
......@@ -390,4 +390,27 @@ function invokeResponsiveMenuEBI() {
});
}
/* Allow invokation of of foundation and foundationExtendEBI with data attributes
<body data-foundationInvoke="document" data-foundationExtendEBI="document">
This saves the need of placing the below on your page:
<script type="text/JavaScript">$(document).foundation();</script>
<script type="text/JavaScript">$(document).foundationExtendEBI();</script>
Background: https://github.com/ebiwd/EBI-Framework/issues/77
*/
var bodyData = $('body').data();
if (bodyData.foundationInvoke) {
bodyData.foundationInvoke = bodyData.foundationInvoke || 'document';
if (bodyData.foundationInvoke === 'true') bodyData.foundationInvoke = 'document';
$(bodyData.foundationInvoke).foundation();
}
if (bodyData.foundationExtendEBI) {
bodyData.foundationExtendEBI = bodyData.foundationExtendEBI || 'document';
if (bodyData.foundationExtendEBI === 'true') bodyData.foundationExtendEBI = 'document';
$(bodyData.foundationExtendEBI).foundationExtendEBI();
}
}(jQuery));
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment