parent
b9b9a867f4
commit
12e845c3ab
File diff suppressed because it is too large
Load Diff
@ -1,17 +1,18 @@
|
||||
/**
|
||||
* Created by Tim on 7/22/16.
|
||||
*/
|
||||
app.directive('ellipsisShow',function(){
|
||||
app.directive('ellipsisShow',["$timeout",function(timer){
|
||||
return{
|
||||
restrict: 'A',
|
||||
scope: {},
|
||||
link: function(scope, element){
|
||||
var textWrap = element.children().eq(0);
|
||||
var textHeight = textWrap[0].scrollHeight;
|
||||
console.log(textWrap[0].innerHTML);
|
||||
while (textHeight > 100) {
|
||||
textWrap[0].innerTEXT = "replaced";
|
||||
}
|
||||
timer(function() {
|
||||
var textContent = element.text();
|
||||
console.log(textContent);
|
||||
//while (textHeight > 100) {
|
||||
// element.text(element.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, "..."));
|
||||
//}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}]);
|
Loading…
Reference in new issue