From 7d2975c138674d76d3d2104f449d87073eb8ef72 Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Wed, 5 May 2010 03:59:26 +0000 Subject: [PATCH] "MDL-22323, fixed right layout unit event" --- mod/chat/gui_ajax/module.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/chat/gui_ajax/module.js b/mod/chat/gui_ajax/module.js index 3b2fd790223..13895394efb 100644 --- a/mod/chat/gui_ajax/module.js +++ b/mod/chat/gui_ajax/module.js @@ -46,9 +46,12 @@ M.mod_chat_ajax.init = function(Y, cfg) { }); this.layout.on('render', function() { - this.getUnitByPosition('left').on('close', function() { - closeLeft(); - }); + var unit = this.getUnitByPosition('right'); + if (unit) { + unit.on('close', function() { + closeLeft(); + }); + } }, this.layout); this.layout.render();