Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/angular-ellipsis.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ angular.module('dibari.angular-ellipsis', [])
ellipsisSeparator: '@',
useParent: "@",
ellipsisSeparatorReg: '=',
ellipsisFallbackFontSize:'@'
ellipsisFallbackFontSize: '@',
dataOverflowed: '=ellipsisDataOverflowed'
},
compile: function(elem, attr, linker) {

Expand Down Expand Up @@ -128,6 +129,7 @@ angular.module('dibari.angular-ellipsis', [])
element.text(binding).html(element.html() + appendString);
}
//Set data-overflow on element for targeting
scope.dataOverflowed = true;
element.attr('data-overflowed', 'true');

// Set complete text and remove one word at a time, until there is no overflow
Expand Down Expand Up @@ -168,6 +170,7 @@ angular.module('dibari.angular-ellipsis', [])
}
}
else{
scope.dataOverflowed = false;
element.attr('data-overflowed', 'false');
}
}
Expand All @@ -183,7 +186,7 @@ angular.module('dibari.angular-ellipsis', [])
*/
function isOverflowed(thisElement, useParent) {
thisElement = useParent ? thisElement.parent() : thisElement;
return thisElement[0].scrollHeight > thisElement[0].clientHeight;
return thisElement[0].scrollHeight > thisElement[0].clientHeight || thisElement[0].scrollWidth > thisElement[0].clientWidth;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/angular-ellipsis.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.