mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
migrated resizeable sidebar to common dragdrop class. This prevents breaking jscalendar on internet explorer and other DHTML incompatible browsers
This commit is contained in:
parent
c58a299113
commit
0d9ed45db1
12
phpgwapi/js/dragDropFunctions.js
Normal file
12
phpgwapi/js/dragDropFunctions.js
Normal 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);
|
||||||
|
}
|
@ -1,26 +1,25 @@
|
|||||||
<!-- Savant template - sidebox dhtml -->
|
|
||||||
<?php
|
<?php
|
||||||
// workaround to get rid of the "too much recursion" timeout if other app uses wz_dragdrop too
|
require_once(EGW_INCLUDE_ROOT . '/phpgwapi/inc/class.dragdrop.inc.php');
|
||||||
// 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;
|
|
||||||
|
|
||||||
function my_DragFunc()
|
if($GLOBALS['egw_info']['user']['preferences']['common']['enable_dragdrop'])
|
||||||
{
|
{
|
||||||
if (dd.obj == rt)
|
$dragdrop = new dragdrop();
|
||||||
{
|
|
||||||
mainbox.resizeTo(rt.x-rtxstart+<?php print $this->sideboxwidth?>, mainbox.h);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function my_DropFunc()
|
$dragdrop->addCustom(
|
||||||
{
|
'thesideboxcolumn',
|
||||||
xajax_doXMLHTTP("preferences.ajaxpreferences.storeEGWPref","common","idotssideboxwidth",mainbox.w);
|
array('NO_DRAG'),
|
||||||
}
|
false,
|
||||||
</script>
|
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();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user