Author: jcompagner
Date: Thu Mar  1 04:01:26 2007
New Revision: 513291

URL: http://svn.apache.org/viewvc?view=rev&rev=513291
Log:
some IE fixes

Modified:
    
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/ajax/wicket-ajax.js
    
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/markup/html/wicket-event.js

Modified: 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/ajax/wicket-ajax.js
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/ajax/wicket-ajax.js?view=diff&rev=513291&r1=513290&r2=513291
==============================================================================
--- 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/ajax/wicket-ajax.js
 (original)
+++ 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/ajax/wicket-ajax.js
 Thu Mar  1 04:01:26 2007
@@ -874,6 +874,8 @@
                        Wicket.Log.info("Response processed successfully.");    
                
                        Wicket.Ajax.invokePostCallHandlers();
                        // retach the events to the new components (a bit blunt 
method...)
+                       // This should be changed for IE See comments in 
wicket-event.js add (attachEvent/detachEvent)
+                       // IE this will cause double events for everything.. 
(mostly because of the Function.prototype.bind(element))
                        Wicket.Focus.attachFocusEvent();
                        // set the focus to the last component
                        Wicket.Focus.requestFocus();    
@@ -1363,7 +1365,17 @@
 
        setFocus: function(event)
        { 
-               lastFocusId=event.target.id;
+               // IE doesn't pass event into the parameter
+               // don't think this is needed for us because of 
Function.prototype.bind(element)?
+           if ( !event )
+           {
+               event = window.event;
+           }
+       
+           // IE doesn't have the property "target".
+           // Use "srcElement" instead.
+           var target = event.target ? event.target : event.srcElement;
+               lastFocusId=target.id;
                Wicket.Log.info("focus set on " + lastFocusId);
        },
        

Modified: 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/markup/html/wicket-event.js
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/markup/html/wicket-event.js?view=diff&rev=513291&r1=513290&r2=513291
==============================================================================
--- 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/markup/html/wicket-event.js
 (original)
+++ 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/markup/html/wicket-event.js
 Thu Mar  1 04:01:26 2007
@@ -54,6 +54,9 @@
                                element.addEventListener((type == 'mousewheel' 
&& window.gecko) ? 'DOMMouseScroll' : type, fn, false);
                        } else {
                                fn = fn.bind(element);
+                               // Because of the fn.bind (returning a new 
function object)
+                               // you can't detach the event first to be sure 
that there are no doubles :(
+                               //element.detachEvent('on'+type, fn);
                                element.attachEvent('on'+type, fn);
                        }
                }


Reply via email to