From 0d9ed45db1625c063bbd47c63c2df14f20a781cb Mon Sep 17 00:00:00 2001 From: Christian Binder Date: Mon, 5 Feb 2007 19:28:38 +0000 Subject: [PATCH] migrated resizeable sidebar to common dragdrop class. This prevents breaking jscalendar on internet explorer and other DHTML incompatible browsers --- phpgwapi/js/dragDropFunctions.js | 12 +++++ .../templates/idots/sidebox_dhtml.tpl.php | 45 +++++++++---------- 2 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 phpgwapi/js/dragDropFunctions.js diff --git a/phpgwapi/js/dragDropFunctions.js b/phpgwapi/js/dragDropFunctions.js new file mode 100644 index 0000000000..5be181b2ff --- /dev/null +++ b/phpgwapi/js/dragDropFunctions.js @@ -0,0 +1,12 @@ +function dragSidebar() +{ + if(!dd.obj.sideresizeStart) { dd.obj.sideresizeStart = dd.obj.x; } + var mainbox = dd.elements.thesideboxcolumn; + mainbox.resizeTo(dd.obj.x-dd.obj.sideresizeStart+parseInt(dd.obj.my_sideboxwidth), mainbox.h); +} + +function dropSidebar() +{ + var mainbox = dd.elements.thesideboxcolumn; + xajax_doXMLHTTP("preferences.ajaxpreferences.storeEGWPref","common","idotssideboxwidth",mainbox.w); +} \ No newline at end of file diff --git a/phpgwapi/templates/idots/sidebox_dhtml.tpl.php b/phpgwapi/templates/idots/sidebox_dhtml.tpl.php index 36bce9d05f..3498f3c58a 100644 --- a/phpgwapi/templates/idots/sidebox_dhtml.tpl.php +++ b/phpgwapi/templates/idots/sidebox_dhtml.tpl.php @@ -1,26 +1,25 @@ - - - - \ No newline at end of file + $dragdrop->addCustom( + 'thesideboxcolumn', + array('NO_DRAG'), + false, + false, + false + ); + + $dragdrop->addCustom( + 'sideresize', + array('CURSOR_W_RESIZE','MAXOFFBOTTOM+0','MAXOFFTOP+0','MAXOFFLEFT+1000','MAXOFFRIGHT+1000'), + array('sideboxwidth'=>$this->sideboxwidth), + 'phpgwapi.dragDropFunctions.dragSidebar', + 'phpgwapi.dragDropFunctions.dropSidebar' + ); + + $dragdrop->setJSCode(); +} \ No newline at end of file