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