-
Notifications
You must be signed in to change notification settings - Fork 239
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
added Bootstrap 3 support and some options #39
Conversation
Now it can add the button before the input, create button and input container when class are set, and can create Bootstrap input group.
Is this change merged with main branch? Can i get bootstrap3 compatibility with latest download? |
Friends have patience because I have not had time to test yet. |
abdulazeezsk, of course. Using this methtod (from my commit) you can get a file input such Bootstrap 3 button group: Sample of creating a Bootstrap 3 input group:
Note that i haven't tested it on all borwsers. |
should be
or it will not work if you create more than one file input. |
Solved, but not tested. Also now its not needed to explicit 'bootstrap-filestyle' in 'containerClass', its added in the function. |
I had to modify your code slightly to make it work. The problem is the selector: // Data attributes register $('.filestyle').each(function () { var $this = $(this), options = { 'buttonText': $this.attr('data-buttonText'), 'input': $this.attr('data-input') === 'false' ? false : true, 'icon': $this.attr('data-icon') === 'false' ? false : true, 'classButton': $this.attr('data-classButton'), 'classInput': $this.attr('data-classInput'), 'classIcon': $this.attr('data-classIcon') }; $this.filestyle(options); }); may run before the document is fully loaded. It certainly does in my case as it ignores any DOM items with class="filestyle". Wrapping this selector to make it wait for the $( document ).ready() event does the trick: $(function() { $('.filestyle').each(function() { var $this = $(this), options = { 'buttonText': $this.attr('data-buttonText'), 'input': $this.attr('data-input') === 'false' ? false : true, 'icon': $this.attr('data-icon') === 'false' ? false : true, 'classButton': $this.attr('data-classButton'), 'classInput': $this.attr('data-classInput'), 'classIcon': $this.attr('data-classIcon') }; $this.filestyle(options); }); }); |
julianz, i was thinking about it. Since i made those changes, i was using Yii (PHP) framework, and, of course, it loaded the script using Issues apart, i think it should be free when it would be applied. So, per example, in an AJAX request may it will be applied after In this case, so as in all others, i have it not tested yet. Anyway, thanks for the aportation :) |
Ok, in my case it is a bit different. Those changes are to adapt HTML elements to BS3 HTML structure, and doing it more customizable. Date selectors was made with my jQuery plugin. More info: https://github.com/egea1981/jquery.dateselector |
Awesome, thanks! 😄 |
Now it can add the button before the input, create button and input container when class are set, and can create Bootstrap input group.