1 | import $ from './jquery';
|
2 | import 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 | */
|
12 | function isClipped (el) {
|
13 | el = $(el);
|
14 | return (el.prop('scrollWidth') > el.prop('clientWidth'));
|
15 | }
|
16 |
|
17 | globalize('isClipped', isClipped);
|
18 |
|
19 | export default isClipped;
|