Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var blockDescription = $(".js-description", pageContent);
- var description = events.Items[0].Description;
- var lengthDescription = description.length;
- function expandDescription() {
- if (lengthDescription > 70) {
- if (blockDescription.hasClass("active")) {
- return $(".description", blockDescription).text(description);
- } else {
- return $(".description", blockDescription).text(clickout.StringUtils.ShortText(description, 70));
- }
- } else {
- $(".description", blockDescription).text(description);
- blockDescription.removeClass("expand");
- }
- };
- expandDescription();
- blockDescription
- .click(function (event) {
- if ($(event.target).closest("a").length == 0 && lengthDescription > 70) {
- $(this).toggleClass("active");
- var xx = expandDescription();
- xx;
- }
- return false;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement