From 91e111f41d33f065f6e37e78ed6a1e1b3da4190e Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 10 Jul 2012 12:32:13 -0400 Subject: fixed tag validation on the "ask" page --- askbot/skins/common/media/js/post.js | 7 ++++--- askbot/skins/default/media/style/style.less | 8 ++++++-- askbot/skins/default/templates/widgets/tag_editor.html | 6 +++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js index 5b30b2bc..4639e974 100644 --- a/askbot/skins/common/media/js/post.js +++ b/askbot/skins/common/media/js/post.js @@ -2505,7 +2505,7 @@ TagEditor.prototype.addTag = function(tag_name) { TagEditor.prototype.immediateClearErrorMessage = function() { this._error_alert.html(''); this._error_alert.show(); - this._element.css('margin-top', '18px');//todo: the margin thing is a hack + //this._element.css('margin-top', '18px');//todo: the margin thing is a hack } TagEditor.prototype.clearErrorMessage = function(fade) { @@ -2526,7 +2526,7 @@ TagEditor.prototype.setErrorMessage = function(text) { this._error_alert.hide(); this._error_alert.fadeIn(100); } - this._element.css('margin-top', '0');//todo: remove this hack + //this._element.css('margin-top', '0');//todo: remove this hack }; TagEditor.prototype.getAddTagHandler = function() { @@ -2678,7 +2678,7 @@ 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._error_alert = $('.tag-editor-error-alert'); + this._error_alert = $('.tag-editor-error-alert > span'); var me = this; this._tags_container.children().each(function(idx, elem){ @@ -3081,6 +3081,7 @@ CategoryAdder.prototype.createDom = function() { var input = this.makeElement('input'); this._input = input; input.addClass('add-category'); + input.attr('name', 'add_category'); this._element.append(input); //add save category button var save_button = this.makeElement('button'); diff --git a/askbot/skins/default/media/style/style.less b/askbot/skins/default/media/style/style.less index 00bb4be5..f6c976fc 100644 --- a/askbot/skins/default/media/style/style.less +++ b/askbot/skins/default/media/style/style.less @@ -3637,11 +3637,15 @@ textarea.tipped-input { height: 13px; } } - input.new-tags-input { - border-style: none; + input.new-tags-input, + input.new-tags-input:focus { + border: none; font-size: 15px; font-color: @info-text; line-height: 16px; margin-top: 9px; + -webkit-box-shadow: none;/* undo bootstrap glow */ + -moz-box-shadow: none; + box-shadow: none; } } diff --git a/askbot/skins/default/templates/widgets/tag_editor.html b/askbot/skins/default/templates/widgets/tag_editor.html index 53a73130..8f3fa8cd 100644 --- a/askbot/skins/default/templates/widgets/tag_editor.html +++ b/askbot/skins/default/templates/widgets/tag_editor.html @@ -1,6 +1,9 @@ {% import "macros.html" as macros %}

+ class="tag-editor-error-alert" +> + +

{# there's a hack with the margin in js as well #} {{ macros.tag_list_widget( tag_names, @@ -11,6 +14,7 @@