summaryrefslogtreecommitdiff
path: root/program/js/common.js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2009-06-01 15:35:53 +0000
committerthomascube <thomas@roundcube.net>2009-06-01 15:35:53 +0000
commit0e99d37a18cf81b549b8fc7e8948e9bd338deaad (patch)
treec7b0f67ce397d82314aa33f5c022ca40554eb3c4 /program/js/common.js
parent0ce119869d77215665be6850099cc229b5720963 (diff)
Use event system on the client to handle ajax callbacks
Diffstat (limited to 'program/js/common.js')
-rw-r--r--program/js/common.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/program/js/common.js b/program/js/common.js
index 25b654612..1fd10c255 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -288,8 +288,8 @@ triggerEvent: function(evt, e)
{
var ret, h;
if (typeof e == 'undefined')
- e = {};
- if (typeof e == 'object')
+ e = this;
+ else if (typeof e == 'object')
e.event = evt;
if (this._events && this._events[evt] && !this._event_exec) {
@@ -297,9 +297,9 @@ triggerEvent: function(evt, e)
for (var i=0; i < this._events[evt].length; i++) {
if ((h = this._events[evt][i])) {
if (typeof h.func == 'function')
- ret = h.func.call ? h.func.call(h.obj, this, e) : h.func(this, e);
+ ret = h.func.call ? h.func.call(h.obj, e) : h.func(e);
else if (typeof h.obj[h.func] == 'function')
- ret = h.obj[h.func](this, e);
+ ret = h.obj[h.func](e);
// cancel event execution
if (typeof ret != 'undefined' && !ret)