UNPKG

451 BJavaScriptView Raw
1import $ from './jquery';
2import globalize from './internal/globalize';
3
4/**
5 * Shortcut function to see if passed element is truncated/clipped, eg. with
6 * text-overflow: ellipsis.
7 *
8 * @param {String | Element | jQuery} element The element to check.
9 *
10 * @returns {Boolean}
11 */
12function isClipped (el) {
13 el = $(el);
14 return (el.prop('scrollWidth') > el.prop('clientWidth'));
15}
16
17globalize('isClipped', isClipped);
18
19export default isClipped;