Bug 605678, added another truncated field

This commit is contained in:
Matt Claypotch 2010-11-01 16:36:01 -07:00
Родитель 08c8efe686
Коммит a2ebf037dc
3 изменённых файлов: 34 добавлений и 22 удалений

Просмотреть файл

@ -29,7 +29,7 @@
{{ form.developer_comments.errors|safe }}
{% else %}
{% call empty_unless(addon.developer_comments) %}
{{ addon.developer_comments|nl2br }}
<div id="developer_comments">{{ addon.developer_comments|nl2br }}</div>
{% endcall %}
{% endif %}
</td>

Просмотреть файл

@ -150,7 +150,8 @@
width: 250px;
}
#addon_description {
#addon_description,
#developer_comments {
max-height: 6.4em;
overflow: hidden;
}

Просмотреть файл

@ -1,3 +1,17 @@
$(document).ready(function() {
//Ownership
if ($("#author_list").length) {
initAuthorFields();
}
//Payments
if ($('.payments').length) {
initPayments();
}
});
$(document).ready(function() {
$(".more-actions-view-dropdown").popup(".more-actions-view", {
width: 'inherit',
@ -28,18 +42,26 @@ $(document).ready(function() {
});
});
function truncateFields() {
var originalHTML = $("#addon_description").html();
$("#addon_description").delegate("a.truncate_expand", "click", function(e) {
e.preventDefault();
$("#addon_description").html(originalHTML).css('max-height','none');
})
.vtruncate({
truncText: format("&hellip; <a href='#' class='truncate_expand'>{0}</a>",[gettext("More")])
function truncateFields() {
var els = [
"#addon_description",
"#developer_comments"
];
$(els.join(', ')).each(function(i,el) {
var $el = $(el),
originalHTML = $el.html();
$el.delegate("a.truncate_expand", "click", function(e) {
e.preventDefault();
$el.html(originalHTML).css('max-height','none');
})
.vtruncate({
truncText: format("&hellip; <a href='#' class='truncate_expand'>{0}</a>",[gettext("More")])
});
});
}
function addonFormSubmit() {
parent_div = $(this);
@ -55,21 +77,10 @@ function addonFormSubmit() {
})(parent_div);
}
$("#user-form-template .email-autocomplete")
.attr("placeholder", gettext("Enter a new author's email address"));
$(document).ready(function() {
//Ownership
if ($("#author_list").length) {
initAuthorFields();
}
//Payments
if ($('.payments').length) {
initPayments();
}
});
function initPayments() {
var previews = [