summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-05-14 20:31:56 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-05-14 20:31:56 -0400
commit3ca078f9aef1ae6383ae6dd72fca4811403aeafa (patch)
treeaa84c6b2fc409c345b8c3a7cdb66006221e66e45
parent516c8746c11586c156b20a4faeedc8989843ef78 (diff)
downloadaskbot-3ca078f9aef1ae6383ae6dd72fca4811403aeafa.tar.gz
askbot-3ca078f9aef1ae6383ae6dd72fca4811403aeafa.tar.bz2
askbot-3ca078f9aef1ae6383ae6dd72fca4811403aeafa.zip
fixed height of the tag input box at 64px
-rw-r--r--askbot/skins/common/media/js/post.js26
-rw-r--r--askbot/skins/default/media/style/style.less11
2 files changed, 32 insertions, 5 deletions
diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js
index 87e00688..b830eb94 100644
--- a/askbot/skins/common/media/js/post.js
+++ b/askbot/skins/common/media/js/post.js
@@ -2427,6 +2427,7 @@ TagEditor.prototype.addTag = function(tag_name) {
me.removeSelectedTag(tag_name);
tag.dispose();
$('.acResults').hide();//a hack to hide the autocompleter
+ me.fixHeight();
});
this._tags_container.append(tag.getElement());
this.addSelectedTag(tag_name);
@@ -2437,6 +2438,7 @@ TagEditor.prototype.getAddTagHandler = function() {
return function(tag_name) {
me.addTag(tag_name);
me.clearNewTagInput();
+ me.fixHeight();
};
};
@@ -2477,6 +2479,27 @@ TagEditor.prototype.completeTagInput = function() {
}
};
+TagEditor.prototype.saveHeight = function() {
+ return;
+ var elem = this._visible_tags_input;
+ this._height = elem.offset().top;
+};
+
+TagEditor.prototype.fixHeight = function() {
+ return;
+ var new_height = this._visible_tags_input.offset().top;
+ //@todo: replace this by real measurement
+ var element_height = parseInt(
+ this._element.css('height').replace('px', '')
+ );
+ if (new_height > this._height) {
+ this._element.css('height', element_height + 28);//magic number!!!
+ } else if (new_height < this._height) {
+ this._element.css('height', element_height - 28);//magic number!!!
+ }
+ this.saveHeight();
+};
+
TagEditor.prototype.getTagInputKeyHandler = function() {
var new_tags = this._visible_tags_input;
var me = this;
@@ -2484,6 +2507,7 @@ TagEditor.prototype.getTagInputKeyHandler = function() {
if (e.shiftKey) {
return;
}
+ me.saveHeight();
var key = e.which || e.keyCode;
var text = me.getRawNewTagValue();
//space 32, backspace 8, enter 13
@@ -2503,6 +2527,7 @@ TagEditor.prototype.getTagInputKeyHandler = function() {
if (key !== 8) {
me.setHotBackspace(false);
}
+ me.fixHeight();
return false;
};
}
@@ -2514,6 +2539,7 @@ TagEditor.prototype.decorate = function(element) {
var visible_tags_input = element.find('.new-tags-input');
this._visible_tags_input = visible_tags_input;
+ this.saveHeight();
var me = this;
var tagsAc = new AutoCompleter({
diff --git a/askbot/skins/default/media/style/style.less b/askbot/skins/default/media/style/style.less
index fe0d6e34..49b2ab12 100644
--- a/askbot/skins/default/media/style/style.less
+++ b/askbot/skins/default/media/style/style.less
@@ -3581,20 +3581,21 @@ textarea.tipped-input {
/* tag editor */
.tag-editor {
- height: 36px;
+ height: 64px;
border: #ccc 3px solid;
padding-left: 8px;
ul.tags {
- margin: 7px 0 0 0;
+ margin: 0;
li {
- margin-top: 1px;
+ margin-top: 8px;
}
}
input.new-tags-input {
- line-height: 16px;
+ border-style: none;
font-size: 15px;
font-color: @info-text;
- border-style: none;
+ line-height: 16px;
+ margin-top: 9px;
}
}