From 4d2fd2355ea3273f2278e2fe51cfc19fa0bd2ba1 Mon Sep 17 00:00:00 2001 From: Felix Susanto Date: Fri, 7 Oct 2016 12:28:13 +0800 Subject: [PATCH] adding onTruncate callback --- jQuery.succinct.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jQuery.succinct.js b/jQuery.succinct.js index 63399eb..4ee3edf 100644 --- a/jQuery.succinct.js +++ b/jQuery.succinct.js @@ -16,7 +16,8 @@ var settings = $.extend({ size: 240, omission: '...', - ignore: true + ignore: true, + onTruncated: function(originalText){} }, options); return this.each(function() { @@ -41,6 +42,7 @@ } $(this).html(textTruncated + settings.omission); + settings.onTruncated.call(this, textDefault); } }); };