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.
|
* Created by Tim on 7/22/16.
|
||||||
*/
|
*/
|
||||||
app.directive('ellipsisShow',function(){
|
app.directive('ellipsisShow',["$timeout",function(timer){
|
||||||
return{
|
return{
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
scope: {},
|
scope: {},
|
||||||
link: function(scope, element){
|
link: function(scope, element){
|
||||||
var textWrap = element.children().eq(0);
|
timer(function() {
|
||||||
var textHeight = textWrap[0].scrollHeight;
|
var textContent = element.text();
|
||||||
console.log(textWrap[0].innerHTML);
|
console.log(textContent);
|
||||||
while (textHeight > 100) {
|
//while (textHeight > 100) {
|
||||||
textWrap[0].innerTEXT = "replaced";
|
// element.text(element.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, "..."));
|
||||||
}
|
//}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}]);
|
Loading…
Reference in new issue