summaryrefslogtreecommitdiff
path: root/src/static/js/html10n.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js/html10n.js')
-rw-r--r--src/static/js/html10n.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/static/js/html10n.js b/src/static/js/html10n.js
index bee1fef3..856729b5 100644
--- a/src/static/js/html10n.js
+++ b/src/static/js/html10n.js
@@ -97,21 +97,21 @@ window.html10n = (function(window, document, undefined) {
* MicroEvent - to make any js object an event emitter (server or browser)
*/
- var MicroEvent = function(){}
- MicroEvent.prototype = {
- bind : function(event, fct){
+ var MicroEvent = function(){}
+ MicroEvent.prototype = {
+ bind: function(event, fct){
this._events = this._events || {};
- this._events[event] = this._events[event] || [];
+ this._events[event] = this._events[event] || [];
this._events[event].push(fct);
},
- unbind : function(event, fct){
+ unbind: function(event, fct){
this._events = this._events || {};
- if( event in this._events === false ) return;
+ if( event in this._events === false ) return;
this._events[event].splice(this._events[event].indexOf(fct), 1);
},
- trigger : function(event /* , args... */){
+ trigger: function(event /* , args... */){
this._events = this._events || {};
- if( event in this._events === false ) return;
+ if( event in this._events === false ) return;
for(var i = 0; i < this._events[event].length; i++){
this._events[event][i].apply(this, Array.prototype.slice.call(arguments, 1))
}
@@ -121,8 +121,8 @@ window.html10n = (function(window, document, undefined) {
* mixin will delegate all MicroEvent.js function in the destination object
* @param {Object} the object which will support MicroEvent
*/
- MicroEvent.mixin = function(destObject){
- var props = ['bind', 'unbind', 'trigger'];
+ MicroEvent.mixin = function(destObject){
+ var props = ['bind', 'unbind', 'trigger'];
if(!destObject) return;
for(var i = 0; i < props.length; i ++){
destObject[props[i]] = MicroEvent.prototype[props[i]];