diff --git a/source/Ox.UI/js/Form/FileButton.js b/source/Ox.UI/js/Form/FileButton.js index be95e4d3..24f0dd2c 100644 --- a/source/Ox.UI/js/Form/FileButton.js +++ b/source/Ox.UI/js/Form/FileButton.js @@ -2,16 +2,17 @@ /*@ Ox.FileButton File Button - ([options[, self]]) -> File Button - click click options Options disabled If true, the button is disabled - maxFiles Maximum number of files, or -1 for unlimited - maxSize Maximum total file size in bytes, or -1 for unlimited - title Title of the button + image Symbol name (if type is 'image') + maxFiles Maximum number of files (or -1 for unlimited) + maxSize Maximum total file size in bytes (or -1 for unlimited) + title Title of the button (and its tooltip) type Type of the button ('text' or 'image') width Width of the button in px self Shared private variable + ([options[, self]]) -> File Button + click click @*/ Ox.FileButton = function(options, self) { @@ -19,6 +20,7 @@ Ox.FileButton = function(options, self) { var that = Ox.Element({}, self) .defaults({ disabled: false, + image: '', maxFiles: -1, maxSize: -1, style: 'default', @@ -45,9 +47,13 @@ Ox.FileButton = function(options, self) { self.$button = Ox.Button({ disabled: self.options.disabled, style: self.options.style, - title: self.options.title, + title: self.options.type == 'image' + ? self.options.image + : self.options.title, type: self.options.type, - width: self.options.type == 'image' ? 'auto' : self.options.width + width: self.options.type == 'image' + ? 'auto' + : self.options.width }) .css({ float: 'left' @@ -95,9 +101,7 @@ Ox.FileButton = function(options, self) { return $('') .attr( Ox.extend({ - title: self.options.type == 'text' ? self.options.title - : self.options.maxFiles == 1 ? 'Select File...' - : 'Select Files...', + title: self.options.title, type: 'file' }, self.multiple ? { multiple: true