summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-06-06 17:17:30 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-06-06 17:17:46 -0400
commit45335bccd66515997fc161d5f62550d260965a6b (patch)
tree06ab72193a16449fdca339e1c2b06fc46de98d7e
parentf2733573a87049e416bac727035c21013a9e80af (diff)
downloadaskbot-45335bccd66515997fc161d5f62550d260965a6b.tar.gz
askbot-45335bccd66515997fc161d5f62550d260965a6b.tar.bz2
askbot-45335bccd66515997fc161d5f62550d260965a6b.zip
fixed bug where long tags were truncated in the retagger, as reported by user todofixit
-rw-r--r--askbot/skins/common/media/js/post.js5
-rw-r--r--askbot/skins/common/media/js/utils.js4
-rw-r--r--askbot/skins/default/templates/macros.html1
3 files changed, 7 insertions, 3 deletions
diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js
index 307d3be5..4f023d79 100644
--- a/askbot/skins/common/media/js/post.js
+++ b/askbot/skins/common/media/js/post.js
@@ -1062,10 +1062,11 @@ var questionRetagger = function(){
var tags_str = '';
links.each(function(index, element){
if (index === 0){
- tags_str = $(element).html();
+ //this is pretty bad - we should use Tag.getName()
+ tags_str = $(element).attr('data-tag-name');
}
else {
- tags_str += ' ' + $(element).html();
+ tags_str += ' ' + $(element).attr('data-tag-name');
}
});
return tags_str;
diff --git a/askbot/skins/common/media/js/utils.js b/askbot/skins/common/media/js/utils.js
index 297e3f9a..69e0cb3a 100644
--- a/askbot/skins/common/media/js/utils.js
+++ b/askbot/skins/common/media/js/utils.js
@@ -989,7 +989,9 @@ Tag.prototype.decorate = function(element){
this._delete_icon.decorate(del);
}
this._inner_element = this._element.find('.tag');
- this._name = this.decodeTagName($.trim(this._inner_element.html()));
+ this._name = this.decodeTagName(
+ $.trim(this._inner_element.attr('data-tag-name'))
+ );
if (this._title !== null){
this._inner_element.attr('title', this._title);
}
diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html
index c8dc245f..831c148f 100644
--- a/askbot/skins/default/templates/macros.html
+++ b/askbot/skins/default/templates/macros.html
@@ -263,6 +263,7 @@ poor design of the data or methods on data objects #}
title="{% trans %}see questions tagged '{{ tag }}'{% endtrans %}"
{% endif %}
rel="tag"
+ data-tag-name="{{ tag|replace('*', '&#10045;')|escape }}"
>{{ tag|replace('*', '&#10045;')|truncate(20,True)}}</{% if not is_link or tag[-1] == '*' %}span{% else %}a{% endif %}>
{% if deletable %}
<div class="delete-icon"