diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-14 12:09:43 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-14 12:09:43 -0400 |
commit | 516c8746c11586c156b20a4faeedc8989843ef78 (patch) | |
tree | e7fd166bc32cb6b795f59bdbe0d9c2d6dcfb3c0c /askbot/skins/common/media/js | |
parent | ad755bc881d99e1ff77a8b16cdfd727af47b2219 (diff) | |
download | askbot-516c8746c11586c156b20a4faeedc8989843ef78.tar.gz askbot-516c8746c11586c156b20a4faeedc8989843ef78.tar.bz2 askbot-516c8746c11586c156b20a4faeedc8989843ef78.zip |
completed styling change for the category/tag selector and fixed some usability issues in the tag editor
Diffstat (limited to 'askbot/skins/common/media/js')
-rw-r--r-- | askbot/skins/common/media/js/post.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js index 4b9349e8..87e00688 100644 --- a/askbot/skins/common/media/js/post.js +++ b/askbot/skins/common/media/js/post.js @@ -2401,7 +2401,7 @@ TagEditor.prototype.setSelectedTags = function(tag_names) { TagEditor.prototype.addSelectedTag = function(tag_name) { var tag_names = this._hidden_tags_input.val(); this._hidden_tags_input.val(tag_names + ' ' + tag_name); - this._prompt.hide(); + $('.acResults').hide();//a hack to hide the autocompleter }; TagEditor.prototype.removeSelectedTag = function(tag_name) { @@ -2409,9 +2409,6 @@ TagEditor.prototype.removeSelectedTag = function(tag_name) { var idx = $.inArray(tag_name, tag_names); if (idx !== -1) { tag_names.splice(idx, 1) - if (tag_names.length === 0) { - this._prompt.show(); - } } this.setSelectedTags(tag_names); }; @@ -2429,6 +2426,7 @@ TagEditor.prototype.addTag = function(tag_name) { tag.setDeleteHandler(function(){ me.removeSelectedTag(tag_name); tag.dispose(); + $('.acResults').hide();//a hack to hide the autocompleter }); this._tags_container.append(tag.getElement()); this.addSelectedTag(tag_name); @@ -2513,7 +2511,6 @@ TagEditor.prototype.decorate = function(element) { this._element = element; this._hidden_tags_input = element.find('input[name="tags"]');//this one is hidden this._tags_container = element.find('ul.tags'); - this._prompt = element.find('.enter-tags-prompt'); var visible_tags_input = element.find('.new-tags-input'); this._visible_tags_input = visible_tags_input; @@ -2521,7 +2518,9 @@ TagEditor.prototype.decorate = function(element) { var me = this; var tagsAc = new AutoCompleter({ url: askbot['urls']['get_tag_list'], - onItemSelect: function(){ me.completeTagInput() }, + onItemSelect: function(){ + me.completeTagInput(); + }, preloadData: true, minChars: 1, useCache: true, @@ -2531,6 +2530,11 @@ TagEditor.prototype.decorate = function(element) { }); tagsAc.decorate(visible_tags_input); visible_tags_input.keyup(this.getTagInputKeyHandler()); + + element.click(function(e) { + visible_tags_input.focus(); + return false; + }); }; var CategorySelector = function() { |