migrated resizeable sidebar to common dragdrop class. This prevents breaking jscalendar on internet explorer and other DHTML incompatible browsers

This commit is contained in:
Christian Binder 2007-02-05 19:28:38 +00:00
parent c58a299113
commit 0d9ed45db1
2 changed files with 34 additions and 23 deletions

View File

@ -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);
}

View File

@ -1,26 +1,25 @@
<!-- Savant template - sidebox dhtml -->
<?php
// workaround to get rid of the "too much recursion" timeout if other app uses wz_dragdrop too
// if we moved the DHTML here to the dragdrop class we can remove this workaround
$GLOBALS['egw_info']['flags']['wz_dragdrop_runonce_SET_DHTML'] = true;
?>
<script language="JavaScript" type="text/javascript">SET_DHTML("thesideboxcolumn"+NO_DRAG)</script>
<script language="JavaScript" type="text/javascript">ADD_DHTML("sideresize"+CURSOR_W_RESIZE+MAXOFFBOTTOM+0+MAXOFFTOP+0+MAXOFFLEFT+1000+MAXOFFRIGHT+1000)</script>
<script language="JavaScript" type="text/javascript">
var mainbox = dd.elements.thesideboxcolumn;
var rt = dd.elements.sideresize;
var rtxstart= rt.x;
require_once(EGW_INCLUDE_ROOT . '/phpgwapi/inc/class.dragdrop.inc.php');
function my_DragFunc()
{
if (dd.obj == rt)
{
mainbox.resizeTo(rt.x-rtxstart+<?php print $this->sideboxwidth?>, mainbox.h);
}
}
if($GLOBALS['egw_info']['user']['preferences']['common']['enable_dragdrop'])
{
$dragdrop = new dragdrop();
function my_DropFunc()
{
xajax_doXMLHTTP("preferences.ajaxpreferences.storeEGWPref","common","idotssideboxwidth",mainbox.w);
}
</script>
$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();
}