Merge branch 'weixin_guange' of https://git.trustie.net/jacknudt/trustieforge into weixin_guange
commit
94a4ee9525
@ -1,25 +1,25 @@
|
|||||||
/**
|
/**
|
||||||
* Created by Tim on 7/22/16.
|
* Created by Tim on 7/22/16.
|
||||||
*/
|
*/
|
||||||
//app.directive('ellipsisShow',["$timeout",function(timer){
|
app.directive('ellipsisShow',["$timeout",function(timer){
|
||||||
// return{
|
return{
|
||||||
// restrict: 'A',
|
restrict: 'A',
|
||||||
// scope: {},
|
scope: {},
|
||||||
// link: function(scope, element){
|
link: function(scope, element){
|
||||||
// timer(function() {
|
timer(function() {
|
||||||
// var textSplit = element.text().split(" ");
|
var textSplit = element.text().split("");
|
||||||
// var newContent = [];
|
var newContent = [];
|
||||||
// element.text("");
|
element.text("");
|
||||||
// for (var i = 0; i < textSplit.length; i++) {
|
for (var i = 0; i < textSplit.length; i++) {
|
||||||
// newContent = newContent + " " + textSplit[i];
|
newContent = newContent + textSplit[i];
|
||||||
// element.text(newContent);
|
element.text(newContent);
|
||||||
// if(element[0].scrollHeight >= 100){
|
if(element[0].scrollHeight >= 100){
|
||||||
// newContent = newContent + " " + textSplit[i+1] + " " + textSplit[i+2] + " " + textSplit[i+3] + " " + textSplit[i+4] + "...";
|
newContent = newContent + textSplit[i+1] + textSplit[i+2] + textSplit[i+3] + textSplit[i+4] + textSplit[i+5] + textSplit[i+6] + textSplit[i+7] + textSplit[i+8] + textSplit[i+9] + textSplit[i+10] + "...";
|
||||||
// element.text(newContent);
|
element.text(newContent);
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//}]);
|
}]);
|
Loading…
Reference in new issue