[mythtv] new mythweb

Michael Kedl kedlm at knology.net
Thu Jul 24 00:52:12 EDT 2003


On Wed, 2003-07-23 at 23:17, Michael Kedl wrote:
> On Wed, 2003-07-23 at 12:45, Michael Kedl wrote:
> > On Wed, 2003-07-23 at 15:03, Chris Petersen wrote:
> > > > - pop ups work "ok"; but sometimes appear "near by"; probably a web
> > > > browser issue, not your code (but I didn't look into it)
> > > 
> > > It's essentially the browser not capturing mouse events fast enough. I'd
> > > *like* to place them next to the element, instead of related to the
> > > mouse position, but there's no easy way to grab the position of a
> > > particular element in the page (it's long and complicated and doesn't
> > > work in all browsers).
> > > 
> > 
> > I figured as much.  I have some position sniff/set code that works with
> > "most" browsers (konqueror, IE, netscape 7).  I may try it out and post
> > it if it works.
> > 

Here is a small patch that works for me for fixing the "lagging mouse events".
I am simply delaying the mouseover display for about .1s so the mouse events have more time to catch up.
I try to cleanup the timeout I am using in various cases as well.

Not sure if its a great fix, but it does seem to work perfectly for me.

Cheers,
Mike

-------------- next part --------------
--- themes/Default/init.js	2003-07-22 01:14:15.000000000 -0400
+++ /usr/local/apache2/htdocs/myth.new/themes/Default/init.js	2003-07-23 22:45:30.000000000 -0400
@@ -78,7 +78,28 @@
 	I'm open to suggestions for fixing it.
 */
 	var last_shown = null;
-	function show(name) {
+	var gtimeout = null;	// global timeout id
+	var gname = null;	// global name to "show"
+	function show(name)
+	{
+		// store data in global var
+		gname=name;
+
+		// remove timed display if already active
+		if (gtimeout)
+		{
+			clearTimeout(gtimeout);
+		}
+
+		// delay .1s to give position time to be better
+		gtimeout=setTimeout("show1()",100);
+	}
+
+	function show1() {
+	// retrieve data from global var
+		name=gname;
+		gtimeout=null;
+
 	// In case the last was stuck on, let's hide it
 		if (last_shown)
 			hide(last_shown);
@@ -103,6 +124,13 @@
 	}
 
 	function hide(name) {
+		// remove timed display if already active
+		if (gtimeout)
+		{
+			clearTimeout(gtimeout);
+			gtimeout=null;
+		}
+
 		last_shown = null;
 		var field = get_element(name);
 		if (field.style)


More information about the mythtv-dev mailing list