Permalink
Browse files

Commit v.1.3.1

Improve aListeningEvents generation. Now the listening events are taken from oEventsCallbacks property of methods. - Thanks, Ramonacus -
  • Loading branch information...
1 parent f8bded2 commit 59f15e684603428ce60104a8e24e02b86e1d46d0 @tcorral committed Mar 10, 2012
Showing with 46 additions and 8 deletions.
  1. +3 −1 README.md
  2. +14 −2 examples_and_documents/js/Hydra.js
  3. +14 −2 src/Hydra.js
  4. +14 −2 versions/hydra.developer.js
  5. BIN versions/hydra.min.gz
  6. +1 −1 versions/hydra.min.js
View
@@ -1,8 +1,10 @@
# Hydra.js
Hidra.js is a module manager oriented system.
-## Updated to version 1.3.0
+## Updated to version 1.3.1
+#### ChangeLog 1.3.1 :
+ Improve aListeningEvents generation. Now the listening events are taken from oEventsCallbacks property of methods. - Thanks, Ramonacus -
#### ChangeLog 1.3.0 :
Delegate some repetitive jobs to the module instance creator, maintaining the size of Hydra.
@@ -97,12 +97,24 @@
oModule = oModules[sModuleId].creator(oAction);
fpInitProxy = oModule.init;
oModule.__action__ = oAction;
+ oModule.oEventsCallbacks = oModule.oEventsCallbacks || {};
+ oModule.aListeningEvents = (function()
+ {
+ var oEventsCallbacks = oModule.oEventsCallbacks,
+ sKey,
+ aListeningEvents = [];
+ for (sKey in oEventsCallbacks) {
+ if (oEventsCallbacks.hasOwnProperty(sKey)) {
+ aListeningEvents.push(sKey);
+ }
+ }
+ oEventsCallbacks = sKey = null;
+ return aListeningEvents;
+ }());
oModule.init = function () {
oAction.listen(this.aListeningEvents, this.handleAction, this);
fpInitProxy.call(this, arguments);
};
- oModule.aListeningEvents = oModule.aListeningEvents || [];
- oModule.oEventsCallbacks = oModule.oEventsCallbacks || {};
oModule.handleAction = function (oNotifier) {
var fpCallback = this.oEventsCallbacks[oNotifier.type];
if (fpCallback === _undefined_) {
View
@@ -97,12 +97,24 @@
oModule = oModules[sModuleId].creator(oAction);
fpInitProxy = oModule.init;
oModule.__action__ = oAction;
+ oModule.oEventsCallbacks = oModule.oEventsCallbacks || {};
+ oModule.aListeningEvents = (function()
+ {
+ var oEventsCallbacks = oModule.oEventsCallbacks,
+ sKey,
+ aListeningEvents = [];
+ for (sKey in oEventsCallbacks) {
+ if (oEventsCallbacks.hasOwnProperty(sKey)) {
+ aListeningEvents.push(sKey);
+ }
+ }
+ oEventsCallbacks = sKey = null;
+ return aListeningEvents;
+ }());
oModule.init = function () {
oAction.listen(this.aListeningEvents, this.handleAction, this);
fpInitProxy.call(this, arguments);
};
- oModule.aListeningEvents = oModule.aListeningEvents || [];
- oModule.oEventsCallbacks = oModule.oEventsCallbacks || {};
oModule.handleAction = function (oNotifier) {
var fpCallback = this.oEventsCallbacks[oNotifier.type];
if (fpCallback === _undefined_) {
@@ -97,12 +97,24 @@
oModule = oModules[sModuleId].creator(oAction);
fpInitProxy = oModule.init;
oModule.__action__ = oAction;
+ oModule.oEventsCallbacks = oModule.oEventsCallbacks || {};
+ oModule.aListeningEvents = (function()
+ {
+ var oEventsCallbacks = oModule.oEventsCallbacks,
+ sKey,
+ aListeningEvents = [];
+ for (sKey in oEventsCallbacks) {
+ if (oEventsCallbacks.hasOwnProperty(sKey)) {
+ aListeningEvents.push(sKey);
+ }
+ }
+ oEventsCallbacks = sKey = null;
+ return aListeningEvents;
+ }());
oModule.init = function () {
oAction.listen(this.aListeningEvents, this.handleAction, this);
fpInitProxy.call(this, arguments);
};
- oModule.aListeningEvents = oModule.aListeningEvents || [];
- oModule.oEventsCallbacks = oModule.oEventsCallbacks || {};
oModule.handleAction = function (oNotifier) {
var fpCallback = this.oEventsCallbacks[oNotifier.type];
if (fpCallback === _undefined_) {
View
Binary file not shown.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 59f15e6

Please sign in to comment.