Fixed post upload keeping tag suggestions

This commit is contained in:
Marcin Kurczewski 2014-10-18 14:46:27 +02:00
parent 428a1ae18c
commit d18305d779
3 changed files with 8 additions and 2 deletions

1
TODO
View file

@ -3,7 +3,6 @@ first major release.
- autocomplete: don't show items that are already used in tag list (unsure)
- 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)
- posts/listing: add buttons for toggling safety
- posts: fix empty edit snapshots when changing only thumbnail content

View file

@ -264,7 +264,7 @@ App.Controls.TagInput = function($underlyingInput) {
}
function showOrHideTagSiblings(tagName) {
if ($siblings.data('lastTag') === tagName) {
if ($siblings.data('lastTag') === tagName && $siblings.is(':visible')) {
$siblings.slideUp('fast');
$siblings.data('lastTag', null);
return;
@ -335,12 +335,18 @@ App.Controls.TagInput = function($underlyingInput) {
$input.focus();
}
function hideSuggestions() {
$siblings.hide();
$suggestions.hide();
}
_.extend(options, {
setTags: setTags,
getTags: getTags,
removeTag: removeTag,
addTag: addTag,
focus: focus,
hideSuggestions: hideSuggestions,
});
return options;
};

View file

@ -346,6 +346,7 @@ App.Presenters.PostUploadPresenter = function(
if (selectedPosts.length === 0) {
hidePostEditForm();
} else {
tagInput.hideSuggestions();
showPostEditForm(selectedPosts);
}
$el.find('.post-table-op').prop('disabled', selectedPosts.length === 0);