moxiecode/plupload — Issue #435: getPos putting flash browse_button in wrong place
Author: langdonx
Created: 2011-12-04 19:37:01+00:00
State: open

In FireFox 8.0.1, my browse button wasn't working. After some investigation, I found that the browse button was floating at the top of the screen on a different element.

It seems to be an issue relating to how FireFox handles relative/absolute positioning inside of tables. I'm terrible with cross-browser stuff, so my fix is really nasty.

You can see the problem demonstrated here:
http://home.langdonx.com/upload/plu/test_broken.html
http://home.langdonx.com/upload/plu/test_fixed.html

I fixed the minified version, hehe. I fixed it using jQuery's .position(). I realize using jQuery in plupload core is silly, but I needed a quick fix and I was already using jQuery. Also Chrome 16, 17, and IE9 don't need the fix, so:

if (navigator.userAgent.indexOf("Firefox")!=-1) { tt=$('#'+r.settings.container).position();t.x=tt.left;t.y=tt.top; } // overwrites what .getPos found