diff --git a/src/bootstrap-filestyle.js b/src/bootstrap-filestyle.js
index 6dda744..3a89792 100644
--- a/src/bootstrap-filestyle.js
+++ b/src/bootstrap-filestyle.js
@@ -8,7 +8,7 @@
*/
(function ($) {
"use strict";
-
+
var Filestyle = function (element, options) {
this.options = options;
this.$elementFilestyle = [];
@@ -153,17 +153,42 @@
this.$element.attr({'id': id});
}
- html = this.htmlInput()+
- '';
+ var inputContainerOpen = (this.options.classInputContainerClass != '') ? '
' : '';
+ var inputContainerClose = (inputContainerOpen != '') ? '
' : '';
+
+ var buttonContainerOpen = (this.options.classButtonContainerClass != '') ? '' : '';
+ var buttonContainerClose = (buttonContainerOpen != '') ? '
' : '';
+
+ if(this.options.buttonBefore)
+ {
+ html =
+ buttonContainerOpen+
+ ''+
+ buttonContainerClose+
+ inputContainerOpen+
+ this.htmlInput()+
+ inputContainerClose;
+ } else {
+ html =
+ inputContainerOpen+
+ this.htmlInput()+
+ inputContainerClose+
+ buttonContainerOpen+
+ ''+
+ buttonContainerClose;
+ }
- this.$elementFilestyle = $(''+html+'
');
+ this.$elementFilestyle = $(''+html+'
');
var $label = this.$elementFilestyle.find('label');
var $labelFocusableContainer = $label.parent();
-
+
$labelFocusableContainer
.attr('tabindex', "0")
.keypress(function(e) {
@@ -239,9 +264,14 @@
'buttonText': 'Choose file',
'input': true,
'icon': true,
- 'classButton': 'btn',
- 'classInput': 'input-large',
- 'classIcon': 'icon-folder-open'
+ 'buttonBefore': false,
+
+ 'containerClass': 'form-group', // bootstrap-filestyle
+ 'classButtonContainerClass': '',
+ 'classButton': 'btn btn-default',
+ 'classInputContainerClass': '',
+ 'classInput': 'form-control',
+ 'classIcon': 'glyphicon glyphicon-folder-open'
};
$.fn.filestyle.noConflict = function () {