diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-06-06 17:17:30 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-06-06 17:17:46 -0400 |
commit | 45335bccd66515997fc161d5f62550d260965a6b (patch) | |
tree | 06ab72193a16449fdca339e1c2b06fc46de98d7e | |
parent | f2733573a87049e416bac727035c21013a9e80af (diff) | |
download | askbot-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.js | 5 | ||||
-rw-r--r-- | askbot/skins/common/media/js/utils.js | 4 | ||||
-rw-r--r-- | askbot/skins/default/templates/macros.html | 1 |
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('*', '✽')|escape }}" >{{ tag|replace('*', '✽')|truncate(20,True)}}</{% if not is_link or tag[-1] == '*' %}span{% else %}a{% endif %}> {% if deletable %} <div class="delete-icon" |