truncate titles to 30... chars
This commit is contained in:
parent
8f7c84a5d0
commit
77d376a997
|
@ -1,6 +1,11 @@
|
||||||
$('#listLeft ul li a').live("click", function() {
|
$('#listLeft ul li a').live("click", function() {
|
||||||
// alert("foo");
|
// alert("foo");
|
||||||
// e.preventDefault();
|
// e.preventDefault();
|
||||||
|
if ($(this).hasClass("listLeftSelected")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$('.listLeftSelected').removeClass("listLeftSelected");
|
||||||
|
$(this).addClass('listLeftSelected');
|
||||||
var objId = $(this).attr("data-id");
|
var objId = $(this).attr("data-id");
|
||||||
var tabId = $('.innerSelected').attr("data-id");
|
var tabId = $('.innerSelected').attr("data-id");
|
||||||
$.getJSON("/m/get_details", {
|
$.getJSON("/m/get_details", {
|
||||||
|
@ -15,9 +20,16 @@ $('#listLeft ul li a').live("click", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function getLi(item) {
|
function getLi(item) {
|
||||||
|
var titleLength = 30;
|
||||||
var $li = $('<li />').addClass("tabListItem");
|
var $li = $('<li />').addClass("tabListItem");
|
||||||
var $a = $('<a />').attr("href", '#').attr("data-id", item.id).appendTo($li);
|
var $a = $('<a />').attr("href", '#').attr("data-id", item.id).appendTo($li);
|
||||||
var $span = $('<span />').text(item.title).appendTo($a);
|
// console.log(item.title.length);
|
||||||
|
if (item.title.length > titleLength) {
|
||||||
|
var title = item.title.substring(0,titleLength) + "...";
|
||||||
|
} else {
|
||||||
|
var title = item.title;
|
||||||
|
}
|
||||||
|
var $span = $('<span />').text(title).appendTo($a);
|
||||||
return $li;
|
return $li;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
itf/static/js/jquery.js
vendored
1
itf/static/js/jquery.js
vendored
|
@ -1 +0,0 @@
|
||||||
jquery-1.6.2.min.js
|
|
|
@ -67,7 +67,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li id="loadingList">Loading...</li>
|
<li id="loadingList">Loading...</li>
|
||||||
{% for l in default_list %}
|
{% for l in default_list %}
|
||||||
<li class="tabListItem"><a href="{{ l.url }}" data-id="{{ l.id }}"><span>{{ l.title }}</span></a></li>
|
<li class="tabListItem"><a href="{{ l.url }}" data-id="{{ l.id }}"><span>{{ l.title|slice:"30" }}{% if l.title|length > 30 %}...{% endif %}</span></a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<!-- <li><a href=""><span>The Mystery of vanishing rights<span></a></li> -->
|
<!-- <li><a href=""><span>The Mystery of vanishing rights<span></a></li> -->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user