[Fusionforge-commits] r13010 - in trunk/src: common/docman/views www/docman www/docman/scripts

Franck VILLAUME nerville at fusionforge.org
Sun Apr 3 20:24:57 CEST 2011


Author: nerville
Date: 2011-04-03 20:24:56 +0200 (Sun, 03 Apr 2011)
New Revision: 13010

Modified:
   trunk/src/common/docman/views/listfile.php
   trunk/src/www/docman/index.php
   trunk/src/www/docman/scripts/DocManController.js
Log:
first attempt to implement draggable div

Modified: trunk/src/common/docman/views/listfile.php
===================================================================
--- trunk/src/common/docman/views/listfile.php	2011-04-03 17:09:22 UTC (rev 13009)
+++ trunk/src/common/docman/views/listfile.php	2011-04-03 18:24:56 UTC (rev 13010)
@@ -101,17 +101,22 @@
 		buttonAddItem:		jQuery('#docman-additem'),
 		buttonEditDirectory:	jQuery('#docman-editdirectory'),
 		docManURL:		'<?php util_make_uri("docman") ?>',
-		lockIntervalDelay:	60000 //in microsecond and if you change this value, please update the check value 600
+		lockIntervalDelay:	60000, //in microsecond and if you change this value, please update the check value 600
+		divLeft:		jQuery('#left'),
+		divHandle:		jQuery('#handle'),
+		divRight:		jQuery('#right')
 	});
 });
 
 </script>
 
 <?php
-echo '<div style="float:left; width:17%; padding-right:3px; margin-right:2px; border-right: dashed 1px black;">';
+echo '<div id="left" "style="float:left; width:17%;">';
 include ($gfcommon.'docman/views/tree.php');
 echo '</div>';
-echo '<div style="float:left; width:82%;">';
+echo '<div id="handle" style="float:left; height:100px; margin:1px; width:3px; background: #000;"></div>';
+echo '<div id="right" "style="float:left;">';
+echo '<div style="overflow:auto;">';
 if ($DocGroupName) {
 	echo '<h3 class="docman_h3" >Directory : <i>'.$DocGroupName.'</i> ';
 	if (forge_check_perm('docman', $group_id, 'approve')) {
@@ -370,7 +375,7 @@
 } else {
 	echo '<p class="warning">'._('No documents to display').'</p>';
 }
-
 echo '</div>';
+echo '</div>';
 echo '<div style="clear:both"; />';
 ?>
\ No newline at end of file

Modified: trunk/src/www/docman/index.php
===================================================================
--- trunk/src/www/docman/index.php	2011-04-03 17:09:22 UTC (rev 13009)
+++ trunk/src/www/docman/index.php	2011-04-03 18:24:56 UTC (rev 13010)
@@ -120,7 +120,7 @@
 
 $title = _('Document Manager');
 
-site_project_header(array('title'=>$title,'group'=>$group_id,'toptab'=>'docman'));
+site_project_header(array('title'=>$title, 'group'=>$group_id, 'toptab'=>'docman'));
 
 echo '<div>';
 include ($gfcommon.'docman/views/menu.php');

Modified: trunk/src/www/docman/scripts/DocManController.js
===================================================================
--- trunk/src/www/docman/scripts/DocManController.js	2011-04-03 17:09:22 UTC (rev 13009)
+++ trunk/src/www/docman/scripts/DocManController.js	2011-04-03 18:24:56 UTC (rev 13010)
@@ -31,17 +31,18 @@
 	this.lockInterval	= [];
 	this.params		= params;
 
-	if ( typeof(jQuery(window).tipsy) == 'function') {
+	if (typeof(jQuery(window).tipsy) == 'function') {
 		this.initTipsy();
 	}
 	this.bindControls();
+	this.resizableDiv();
 };
 
 DocManAddItemController = function(params)
 {
 	this.params		= params;
 
-	if ( typeof(jQuery(window).tipsy) == 'function') {
+	if (typeof(jQuery(window).tipsy) == 'function') {
 		this.initTipsy();
 	}
 	this.bindControls();
@@ -51,7 +52,7 @@
 {
 	this.params		= params;
 
-	if ( typeof(jQuery(window).tipsy) == 'function') {
+	if (typeof(jQuery(window).tipsy) == 'function') {
 		this.initTipsy();
 	}
 };
@@ -66,6 +67,24 @@
 		this.params.buttonAddItem.click(jQuery.proxy(this, "toggleAddItemView"));
 	},
 
+	resizableDiv:function() {
+		this.params.divHandle.mousedown(jQuery.proxy(this, "dragging"));
+		var params = this.params;
+		var w = jQuery('body').width() - 18;
+		jQuery(document).mouseup(function(){isDragging = false;}).mousemove(function(e){
+			if (typeof(isDragging) != 'undefined') {
+				if (isDragging) {
+					params.divLeft.css('width', e.pageX);
+					params.divRight.css('width', w - e.pageX);
+				}
+			}
+		});
+	},
+
+	dragging: function() {
+		isDragging = true;
+	},
+
 	/*! initializes tipsy
 	 */
 	initTipsy: function()




More information about the Fusionforge-commits mailing list