From abc6cbbb15030559dda0768ff4cb69640b903d01 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 27 Jun 2012 12:55:38 +0200 Subject: [PATCH] FileButton: add default for image options --- source/Ox.UI/js/Form/FileButton.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/Form/FileButton.js b/source/Ox.UI/js/Form/FileButton.js index 24f0dd2c..4720acdb 100644 --- a/source/Ox.UI/js/Form/FileButton.js +++ b/source/Ox.UI/js/Form/FileButton.js @@ -4,7 +4,8 @@ Ox.FileButton File Button options Options disabled If true, the button is disabled - image Symbol name (if type is 'image') + image Symbol name (if type is 'image') + The default value will be 'files' if maxFiles is not 1 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) @@ -20,7 +21,7 @@ Ox.FileButton = function(options, self) { var that = Ox.Element({}, self) .defaults({ disabled: false, - image: '', + image: options && options.maxFiles == 1 ? 'file' : 'files', maxFiles: -1, maxSize: -1, style: 'default',