-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show all #2
Comments
You want the full text to be shown when the append text is clicked? Or, you want the full text to be shown when any of the concatenated text is clicked? |
Just when I click on append text would be OK. |
I'm running into the same issue. I have angular-ellipsis working and truncating correctly, but when I add For example, here I have my <section
ng-bind="description"
ellipsis
ellipsis-append="Read more"
ellipsis-append-click="showFullText=true"
ng-init="showFullText=false"
ng-class="{'unabbreviated':showFullText}">
</section> section {
max-height: 150px;
}
section.unabbreviated {
max-height: none;
} I can observe in the Web Inspector that the |
I just noticed something: the above is still true, but I can trigger the re-evaluation of the height by resizing my browser just a little. So, to make the above "work", I click Read more, then resize my browser window. It's so close to perfect! |
I seem to have fixed this by calling |
Can u share your code @commandtab ? |
Sorry, I don't think I have that snippet anymore, @Adam-Goldman7. The shipping code ended up with a small directive wrapping jQuery dotdotdot, and that's been working well in production for some time. |
@commandtab, would you mind sharing your dotdotdot angular integration ? |
@max-l It's remarkably short. Once dotdotdot is loaded (I use RequireJS, but really any JS loader ought to work), you keep track of whether you've already applied angularModule.directive('dotdotdot', [function () {
return {
required: 'ngBindHtml',
restrict: 'A',
priority: 100,
link: function ($scope, element, attrs, ctrl) {
$scope.isTruncated = false;
$scope.$watch(element.html(), function (value) {
if (!$scope.isTruncated) {
$scope.isTruncated = true;
element.dotdotdot();
}
})
}
};
}]) Usage might be a little different depending on if your directive's content is being trusted as HTML, but that's the basic idea. |
How can I show all text on click please ? I tried to change the height of element, but I think it needs some 'restart' after then. Can you help me ? Thankx
The text was updated successfully, but these errors were encountered: