Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
make this an AMD project, fix install button
Browse files Browse the repository at this point in the history
  • Loading branch information
jlongster committed Oct 15, 2012
1 parent d3989f8 commit fdbe950
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -6,6 +6,7 @@
"connect": "~2.4.4",
"less-middleware": "~0.1.5"
},
"amd": {},
"volo": {
"dependencies": {
"zepto": "github:madrobby/zepto/v0.8"
Expand Down
2 changes: 1 addition & 1 deletion www/js/install-button.js
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions www/js/lib/install.js
Expand Up @@ -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) {
Expand All @@ -33,7 +33,7 @@ define(function (require) {

function triggerChange(state) {
install.state = state;
install.trigger('change', install.state);
install.trigger('my:change', install.state);
}

/**
Expand Down
10 changes: 10 additions & 0 deletions 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
Expand Down Expand Up @@ -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.