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) - autocomplete: don't show items that are already used in tag list (unsure)
- posts/upload: better hotkeys for going to next post - 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/upload: ability to paste many urls (unsure)
- posts/listing: add buttons for toggling safety - posts/listing: add buttons for toggling safety
- posts: fix empty edit snapshots when changing only thumbnail content - posts: fix empty edit snapshots when changing only thumbnail content

View file

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

View file

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