display correct ui for non-empty file inputs

This commit is contained in:
rolux 2012-06-17 19:14:37 +02:00
parent fe8c97db24
commit fdb8a2b98b

View file

@ -60,9 +60,14 @@ Ox.FileInput = function(options, self) {
self.$button = Ox.Button({ self.$button = Ox.Button({
style: 'symbol', style: 'symbol',
title: 'add', title: self.multiple || self.options.value.length == 0
? 'add' : 'close',
type: 'image' type: 'image'
}) })
.attr({
title: self.multiple || self.options.value.length == 0
? '' : 'Clear'
})
.css({ .css({
float: 'left', float: 'left',
marginTop: '-1px' marginTop: '-1px'
@ -72,7 +77,9 @@ Ox.FileInput = function(options, self) {
}) })
.appendTo(self.$bar); .appendTo(self.$bar);
if (self.multiple || self.options.value.length == 0) {
self.$input = renderInput(); self.$input = renderInput();
}
if (self.multiple) { if (self.multiple) {
self.$files = $('<div>') self.$files = $('<div>')