aboutsummaryrefslogtreecommitdiffstats
path: root/gum/static/js/libs/gumby.init.js
diff options
context:
space:
mode:
authorNick Rance <nick_rance89@hotmail.com>2013-05-31 04:37:59 +0100
committerJustin Mayer <entroP@gmail.com>2013-06-03 17:56:25 -0700
commit28e4ad3299958fd8e377d6969ba016610ed75544 (patch)
tree24cc0bea1d6c6d90134538003374407f81c1745c /gum/static/js/libs/gumby.init.js
parent458f7fb64065103fac2ff1af0a076154fa553b40 (diff)
downloadpelican-themes-28e4ad3299958fd8e377d6969ba016610ed75544.tar.gz
Add new theme: Gum
Diffstat (limited to 'gum/static/js/libs/gumby.init.js')
-rw-r--r--gum/static/js/libs/gumby.init.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/gum/static/js/libs/gumby.init.js b/gum/static/js/libs/gumby.init.js
new file mode 100644
index 0000000..e14f7e2
--- /dev/null
+++ b/gum/static/js/libs/gumby.init.js
@@ -0,0 +1,27 @@
+/**
+* Gumby Init
+*/
+
+// test for touch event support
+Modernizr.load({
+ test: Modernizr.touch,
+
+ // if present load custom jQuery mobile build and update Gumby.click
+ yep: 'js/libs/jquery.mobile.custom.min.js',
+ callback: function(url, result, key) {
+ // check jQuery mobile has successfully loaded before using tap events
+ if($.mobile) {
+ window.Gumby.click = 'tap';
+ }
+ },
+
+ // either way initialize Gumby
+ complete: function() {
+ window.Gumby.init();
+
+ // if AMD return Gumby object to define
+ if(typeof define == "function" && define.amd) {
+ define(window.Gumby);
+ }
+ }
+});