From 8c67bf9462ea5d2236c5e3095899d146deac7f86 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 24 Mar 2012 11:12:24 +0000 Subject: [PATCH] fix a bug in Ox.FileButton --- demos/fileinput/js/fileinput.js | 3 ++- source/Ox.UI/js/Form/Ox.FileButton.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/demos/fileinput/js/fileinput.js b/demos/fileinput/js/fileinput.js index 5dfa042d..fff49f0e 100644 --- a/demos/fileinput/js/fileinput.js +++ b/demos/fileinput/js/fileinput.js @@ -1,6 +1,6 @@ Ox.load('UI', function() { - var files = [], + var files, $menu = Ox.MainMenu({ menus: [ @@ -140,6 +140,7 @@ Ox.load('UI', function() { } }) ), + keys: {enter: 'upload', escape: 'cancel'}, title: 'Files', width: 288 + Ox.UI.SCROLLBAR_SIZE, height: 129 diff --git a/source/Ox.UI/js/Form/Ox.FileButton.js b/source/Ox.UI/js/Form/Ox.FileButton.js index c7becc96..715cc234 100644 --- a/source/Ox.UI/js/Form/Ox.FileButton.js +++ b/source/Ox.UI/js/Form/Ox.FileButton.js @@ -38,6 +38,7 @@ Ox.FileButton = function(options, self) { function selectFiles(e) { var filelist = e.target.files, files = []; + self.files = []; Ox.loop(filelist.length, function(i) { files.push(filelist.item(i)); });