Skip to content
Browse files

make this an AMD project, fix install button

  • Loading branch information...
1 parent d3989f8 commit fdbe9507bafefedd61f3cc5535b93ea6132a4653 @jlongster jlongster committed Oct 15, 2012
Showing with 16 additions and 5 deletions.
  1. +1 −0 package.json
  2. +1 −1 www/js/install-button.js
  3. +4 −4 www/js/lib/install.js
  4. +10 −0 www/js/lib/zepto.js
View
1 package.json
@@ -6,6 +6,7 @@
"connect": "~2.4.4",
"less-middleware": "~0.1.5"
},
+ "amd": {},
"volo": {
"dependencies": {
"zepto": "github:madrobby/zepto/v0.8"
View
2 www/js/install-button.js
@@ -18,7 +18,7 @@ define(function(require) {
install();
});
- install.on('change', update);
+ install.on('my:change', update);
install.on('error', function(e, err) {
// Feel free to customize this
View
8 www/js/lib/install.js
@@ -4,9 +4,9 @@
define(function (require) {
'use strict';
- var $ = require('jquery'),
- dispatcher = $({}),
- prop;
+ var $ = require('zepto');
+ var dispatcher = $('<div>');
+ var prop;
//Create event functions based on dispatcher object
function createDispatchFn(id) {
@@ -33,7 +33,7 @@ define(function (require) {
function triggerChange(state) {
install.state = state;
- install.trigger('change', install.state);
+ install.trigger('my:change', install.state);
}
/**
View
10 www/js/lib/zepto.js
@@ -1,3 +1,6 @@
+//Wrapped in an outer function to preserve global this
+(function (root) { var amdExports; define([], function () { (function () {
+
/* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */
;(function(undefined){
if (String.prototype.trim === undefined) // fix for iOS 3.2
@@ -1353,3 +1356,10 @@ window.Zepto = Zepto
$.fn[m] = function(callback){ return this.bind(m, callback) }
})
})(Zepto)
+
+
+amdExports = Zepto;
+
+}.call(root));
+ return amdExports;
+}); }(this));

0 comments on commit fdbe950

Please sign in to comment.
Something went wrong with that request. Please try again.