Advertisement
Guest User

Untitled

a guest
Sep 15th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             var blockDescription = $(".js-description", pageContent);
  2.             var description = events.Items[0].Description;
  3.             var lengthDescription = description.length;
  4.             function expandDescription() {
  5.                 if (lengthDescription > 70) {
  6.                     if (blockDescription.hasClass("active")) {
  7.                         return $(".description", blockDescription).text(description);
  8.                     } else {
  9.                         return $(".description", blockDescription).text(clickout.StringUtils.ShortText(description, 70));
  10.                     }
  11.                 } else {
  12.                     $(".description", blockDescription).text(description);
  13.                     blockDescription.removeClass("expand");
  14.                 }
  15.             };
  16.             expandDescription();
  17.             blockDescription
  18.                 .click(function (event) {
  19.                     if ($(event.target).closest("a").length == 0 && lengthDescription > 70) {
  20.                         $(this).toggleClass("active");
  21.                         var xx = expandDescription();
  22.                         xx;
  23.                     }
  24.                     return false;
  25.                 });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement