[Mapbender-commits] r1926 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Dec 17 07:00:40 EST 2007
Author: astrid_emde
Date: 2007-12-17 07:00:38 -0500 (Mon, 17 Dec 2007)
New Revision: 1926
Modified:
trunk/mapbender/http/javascripts/mod_dependentDiv.php
Log:
possibility to position the dependenDiv with element_vars
Modified: trunk/mapbender/http/javascripts/mod_dependentDiv.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_dependentDiv.php 2007-12-14 11:34:13 UTC (rev 1925)
+++ trunk/mapbender/http/javascripts/mod_dependentDiv.php 2007-12-17 12:00:38 UTC (rev 1926)
@@ -18,8 +18,9 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-
+$e_id_css = 'dependentDiv';
$gui_id = $_REQUEST["gui_id"];
+include '../include/dyn_js.php';
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db(DB,$con);
@@ -35,14 +36,27 @@
if($cnt > 1){ echo "alert('dependentDiv: ID not unique!');";}
echo "var mod_dependentDiv_target = '".$e_target."';";
?>
-mod_dependentDiv_offsetLeft = 10;
-mod_dependentDiv_offsetTop = 10;
+try{
+ if (dependentDiv_offsetLeft){}
+}
+catch(e){
+ dependentDiv_offsetLeft = 1;
+}
+
+try{
+ if (dependentDiv_offsetTop){}
+}
+catch(e){
+ dependentDiv_offsetTop = 10;
+}
+
+
mb_registerSubFunctions("mod_dependentDiv()");
function mod_dependentDiv(){
var obj = document.getElementById(mod_dependentDiv_target).style;
var thisObj = document.getElementById('dependentDiv').style;
- thisObj.left = parseInt(obj.left) - mod_dependentDiv_offsetLeft;
- thisObj.top = parseInt(obj.top) + parseInt(obj.height) + mod_dependentDiv_offsetTop;
- thisObj.width = parseInt(obj.width) + (2*mod_dependentDiv_offsetTop);
+ thisObj.left = parseInt(obj.left) + dependentDiv_offsetLeft;
+ thisObj.top = parseInt(obj.top) + parseInt(obj.height) + dependentDiv_offsetTop;
+ thisObj.width = parseInt(obj.width) + (2*dependentDiv_offsetTop);
}
\ No newline at end of file
More information about the Mapbender_commits
mailing list