You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2010/04/06 20:15:48 UTC

svn commit: r931253 - /incubator/vcl/trunk/web/js/groups.js

Author: jfthomps
Date: Tue Apr  6 18:15:48 2010
New Revision: 931253

URL: http://svn.apache.org/viewvc?rev=931253&view=rev
Log:
VCL-98

changed AJAX code to use dijit.Tooltip

Modified:
    incubator/vcl/trunk/web/js/groups.js

Modified: incubator/vcl/trunk/web/js/groups.js
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/groups.js?rev=931253&r1=931252&r2=931253&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/groups.js (original)
+++ incubator/vcl/trunk/web/js/groups.js Tue Apr  6 18:15:48 2010
@@ -16,72 +16,50 @@
 */
 var xhrobj;
 var blockHide = 0;
+var currentOver = '';
 
 function getGroupInfo(cont, groupid) {
+	var domid = 'listicon' + groupid;
+	currentOver = domid;
+	dojo.byId(domid).onmouseover = '';
 	xhrobj = dojo.xhrPost({
 		url: 'index.php',
 		load: showGroupInfo,
-		handleAs: "json-comment-filtered",
+		handleAs: "json",
 		error: errorHandler,
 		content: {continuation: cont,
-					 groupid: groupid,
-					 mousex: mouseX,
-					 mousey: mouseY},
+					 groupid: groupid},
 		timeout: 15000
 	});
 }
 
 function mouseoverHelp() {
-	var data = [];
-	data['items'] = [];
-	data['items']['members'] = [];
-	data['items']['members'][0] = 'mouse over icon to<br>display a group&#146;s<br>resources';
-	data['items']['x'] = mouseX;
-	data['items']['y'] = mouseY;
-	showGroupInfo(data);
-}
-
-function showGroupInfo(data, ioArgs) {
-	var members = data.items.members;
-	var mx = data.items.x;
-	var my = data.items.y;
-	var text = "";
-	for(var i = 0; i < members.length; i++) {
-		text = text + members[i] + '<br>';
+	currentOver = 'listicon0';
+	var obj = dijit.byId('listicon0tt');
+	if(! obj) {
+		var tt = new dijit.Tooltip({
+		   id: 'listicon0tt',
+		   connectId: ['listicon0'],
+		   label: 'mouse over icon to<br>display a group&#146;s<br>resources'
+		});
+		tt.open(dojo.byId('listicon0'));
 	}
-	var obj = document.getElementById('content');
-	var x = findPosX(obj);
-	var y = findPosY(obj);
-	obj = document.getElementById('listitems');
-	obj.innerHTML = text;
-	//if(browser == 'IE') {
-		var a = mx - obj.clientWidth - 2;
-		var b = my - (obj.clientHeight / 2);
-	/*}
-	else {
-		var a = mx - x - obj.clientWidth;
-		var b = my - y - obj.clientHeight;
-	}*/
-	obj.style.left = a + "px";
-	obj.style.top = b + "px";
-	obj.style.zIndex = 10;
+	else
+		obj.open(dojo.byId('listicon0'));
 }
 
-function clearGroupPopups() {
-	setTimeout(function() {clearGroupPopups2(1);}, 50);
+function showGroupInfoCancel(groupid) {
+	currentOver = '';
+	dojo.byId('listicon' + groupid).onmouseout = '';
 }
 
-function clearGroupPopups2(fromicon) {
-	if(xhrobj)
-		xhrobj.ioArgs.xhr.abort();
-	if(fromicon && blockHide)
-		return;
-	blockHide = 0;
-	var obj = document.getElementById('listitems');
-	obj.innerHTML = '';
-	obj.style.zIndex = -10;
-}
-
-function blockClear() {
-	blockHide = 1;
+function showGroupInfo(data, ioArgs) {
+	var members = data.items.members;
+	var domid = 'listicon' + data.items.groupid;
+	var tt = new dijit.Tooltip({
+		connectId: [domid],
+		label: members
+	});
+	if(currentOver == domid)
+		tt.open(dojo.byId(domid));
 }