-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flash FileInput + Twitter Bootstrap Button Dropdown component not able to get selected file more than once #53
Comments
swfs and xaps are very sensible to being in a container having |
Thanks so much for looking at it. I'll try your suggestions tonight and, if I get it working, I'll update the fiddle as a working example for future users :) |
Something like this: http://jsfiddle.net/aqxDd/11/ But there several problems there. I never used bootstraps dropdown myself, so not exactly familiar with it. Shouldn't it throw some events when dropdown is shown and hidden? Trying to hook onto a click event, etc is faulty, since dropdwon can be closed for example by clicking outside of it anywhere on the page and then the logic is suddenly broken. For myself I have noted that there should be a way to figure out a proper zIndex for the picker when browse button is buried so deep in DOM structures... hm. |
Thanks for this awesome fiddle! I made a few changes to address the problems you mentioned, and I think it's good to go now: http://jsfiddle.net/eP9cP/5/ You're right, this dropdown plugin is pretty simple and doesn't provide any events to indicate that the dropdown menu is open or closed. I added some click handlers for both the dropdown-toggle button and the document to handle the cases where a user clicks the button or somewhere else on the page. (credit to http://stackoverflow.com/a/12535148) Thanks so much for checking this out and coming up with a great solution! |
Actually there are meant to be some events according to the docs here. |
Ah yes, good to see they added events to the latest version of Bootstrap (3.0). We're actually messing with 2.3.2 in this example, so can't use them yet :) |
I see. But can't you use js from version 3? Are there any conflicts? |
Here: http://jsfiddle.net/aqxDd/14/ works perfectly. |
Nice! Had to remove line 24 and it worked on the second file selection: http://jsfiddle.net/aqxDd/15/ //deleted
$('#pickfiles-container').dropdown('toggle'); |
Something strange about that dropdown, it should work according to the docs. But it should close after file is selected right? I made a workaround here (kinda): http://jsfiddle.net/aqxDd/16/. |
Hi jayarjo,
I have a fiddle here that attempts to use a mOxie FileInput with its container as a dropdown menu item in a 2.3.2 Twitter Bootstrap Button Dropdown component. The fiddle has steps to reproduce, expected, and actual observations. http://jsfiddle.net/aqxDd/5/
The FileInput in unable to register that it has a file on the second file selection attempt. Given the implementation of the Button Dropdown, the FileInput's container element's parent (ul class="dropdown-menu") will have a display:none style when closed and display:block when open.
I believe the toggling of display:none/display:block may be a clue into the reason the FileInput can't get a file the second time, but I'm unfamiliar with swf objects and how they behave when their display is toggled. I can assure that the swf object is displayed at the time when it is used, but when inactive it is not displayed.
Do you think it's possible to get this type of file selection experience to work with moxie?
The text was updated successfully, but these errors were encountered: