diff --git a/TODO b/TODO index a517cfed..09fd90b8 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ This is transient file that lists functionalities to be implemented before first major release. - autocomplete: don't show items that are already used in tag list (unsure) -- posts/upload: when adding multiple files, select first one, not last one - posts/upload: better hotkeys for going to next post - posts/upload: get rid of suggested tags after selecting next post - posts/upload: ability to paste many urls (unsure) diff --git a/public_html/js/Presenters/PostUploadPresenter.js b/public_html/js/Presenters/PostUploadPresenter.js index 9b719aa4..9ed11fcc 100644 --- a/public_html/js/Presenters/PostUploadPresenter.js +++ b/public_html/js/Presenters/PostUploadPresenter.js @@ -107,12 +107,18 @@ App.Presenters.PostUploadPresenter = function( } } $input.val(''); - addPostFromUrl(url); + var post = addPostFromUrl(url); + selectPostTableRow(post); } function fileHandlerChanged(files) { - for (var i = 0; i < files.length; i ++) { - addPostFromFile(files[i]); + if (files.length > 0) { + var posts = []; + for (var i = 0; i < files.length; i ++) { + var post = addPostFromFile(files[i]); + posts.push(post); + } + selectPostTableRow(_.first(posts)); } } @@ -251,6 +257,7 @@ App.Presenters.PostUploadPresenter = function( }); postAdded(post); + return post; } function addPostFromUrl(url) { @@ -266,6 +273,7 @@ App.Presenters.PostUploadPresenter = function( post.thumbnail = url; postThumbnailLoaded(post); } + return post; } function createPostTableRow(post) { @@ -286,7 +294,6 @@ App.Presenters.PostUploadPresenter = function( postChanged(post); - selectPostTableRow(post); showOrHidePostsTable(); }