Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for ender #2

Merged
merged 1 commit into from Jun 18, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/ender.js
@@ -1,6 +1,8 @@
(function ($) {
var Events = require('events');
var Events = require('eventify');
$.ender({
eventify: Events.enable
eventify: function () {
return Events.enable.apply(Events, arguments);
}
});
}(ender));
16 changes: 7 additions & 9 deletions lib/eventify.js
Expand Up @@ -13,7 +13,11 @@
// Eventify.enable(object);
// object.on('expand', function(){ alert('expanded'); });
// object.trigger('expand');
(function (root) {
(function (name, global, definition) {
if (typeof module !== 'undefined') module.exports = definition(name, global);
else if (typeof define === 'function' && typeof define.amd === 'object') define(definition);
else global[name] = definition(name, global);
})(this.localEventifyLibraryName || "Eventify", this, function (localName, root) {
'use strict';

// Eventify, based on Backbone.Events
Expand All @@ -31,7 +35,6 @@
// by your application and you want a different name. For example:
// // Declare before including the Eventify library
// var localEventifyLibraryName = 'EventManager';
localName = root.localEventifyLibraryName || "Eventify",

// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
Expand Down Expand Up @@ -202,12 +205,7 @@
// for Closure Compiler "advanced" mode.
EventifyInstance = new Eventify();
// Sets Eventify on the browser window or on the process
((typeof exports !== 'undefined') ? exports : root)[localName] = EventifyInstance;
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
module.exports = EventifyInstance;
}
}
return EventifyInstance;

// Establish the root object, `window` in the browser, or `global` on the server.
}(this));
});
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -57,7 +57,7 @@
"files": "test/*.js"
},
"ender": "./lib/ender.js",
"main": "index",
"main": "./lib/eventify.js",
"directories": {
"lib": "./lib"
}
Expand Down