documentation for truncate fitler + only space between dots and words in wordwise mode.
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
/**
|
||||
* @ngdoc filter
|
||||
* @name umbraco.filters.filter:truncate
|
||||
* @namespace truncateFilter
|
||||
*
|
||||
* param {any} wordwise if true, the string will be cut after last fully displayed word.
|
||||
* param {any} max max length of the outputtet string
|
||||
* param {any} tail option tail, defaults to: ' ...'
|
||||
*
|
||||
* @description
|
||||
* Limits the length of a string, if a cut happens only the string will be appended with three dots to indicate that more is available.
|
||||
*/
|
||||
angular.module("umbraco.filters").filter('truncate',
|
||||
function () {
|
||||
return function (value, wordwise, max, tail) {
|
||||
@@ -13,7 +25,7 @@ angular.module("umbraco.filters").filter('truncate',
|
||||
value = value.substr(0, lastspace);
|
||||
}
|
||||
}
|
||||
return value + (tail || ' …');
|
||||
return value + (tail || (wordwise ? ' …' : '…'));
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user