|
|
@@ -16,8 +16,7 @@
|
|
|
msg: '=ngHistoryMsg',
|
|
|
appContent: '=ngAppContent',
|
|
|
count: '=ngCount',
|
|
|
- height: '=ngHeight',
|
|
|
- index: '=ngIndex'
|
|
|
+ height: '=ngHeight'
|
|
|
}
|
|
|
};
|
|
|
return directive;
|
|
|
@@ -73,8 +72,7 @@
|
|
|
while (g !== null) {
|
|
|
content = content.replace(g[0],
|
|
|
'<a class="thumbnail"' + '>' +
|
|
|
- // '<img onclick="javascript:window.open(this.src,\'\',\'height=600,width=800,top=200,left=200\')" class="lazy" style="max-width:270px;max-height:250px;" src="../img/loading.gif" data-original="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="截图缩略图" >' +
|
|
|
- '<img onclick="javascript:window.open(this.src,\'\',\'height=600,width=800,top=200,left=200,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no\')" style="max-width:300px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="截图缩略图" >' +
|
|
|
+ '<img ng-load="scrollController()" ng-error="scrollController()" onclick="javascript:window.open(this.src,\'\',\'height=600,width=800,top=200,left=200\')" style="max-width:300px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="截图缩略图" >' +
|
|
|
'</a>'
|
|
|
);
|
|
|
g = (/\[image\-src=\"([\w\W]+?)\"\]/i).exec(content);
|
|
|
@@ -116,7 +114,7 @@
|
|
|
|
|
|
var replaceImage = function(content) {}
|
|
|
var html = '';
|
|
|
- var message = document.getElementById("loadmore");
|
|
|
+ var message = element;
|
|
|
if (scope.msg.senderDisplayName === undefined || scope.msg.senderDisplayName == '')
|
|
|
scope.msg.senderDisplayName = scope.msg.sender;
|
|
|
// 消息类型([1,文本消息],[2,图片消息],[3,文件消息], [4,位置消息],[5,语音消息])
|
|
|
@@ -188,7 +186,7 @@
|
|
|
}
|
|
|
|
|
|
if (getUserID()) {
|
|
|
- var html_g = '<div class="feed-element">' +
|
|
|
+ var html_g = '<div class="feed-element" ng-cloak>' +
|
|
|
'<div class="media-body">' +
|
|
|
'<p><strong>' +
|
|
|
scope.msg.senderDisplayName +
|
|
|
@@ -198,7 +196,7 @@
|
|
|
'<div class="text-point"></div>' + html +
|
|
|
'</div></div></div>';
|
|
|
} else {
|
|
|
- var html_g = '<div class="feed-element">' +
|
|
|
+ var html_g = '<div class="feed-element" ng-cloak>' +
|
|
|
'<div class="media-body">' +
|
|
|
'<p><strong>' +
|
|
|
scope.msg.senderDisplayName +
|
|
|
@@ -215,28 +213,13 @@
|
|
|
// 也可以用$scope.$new()创建继承的作用域
|
|
|
var $dom = compileFn(scope);
|
|
|
// 添加到文档中
|
|
|
- angular.element("#loadmore").prepend($dom);
|
|
|
+ angular.element(".loadmore").prepend($dom);
|
|
|
if (scope.count) {
|
|
|
gotoBottom();
|
|
|
- window.scrollTo(0, document.body.scrollHeight);
|
|
|
- } else if (scope.index % 8 == 0) {
|
|
|
- console.log(scope.index % 8);
|
|
|
- message.addEventListener('ready', window.scrollTo(0, document.body.scrollHeight - scope.height));
|
|
|
- console.log(document.body.scrollHeight - scope.height);
|
|
|
+ message.addEventListener('load', window.scrollTo(0, document.body.scrollHeight));
|
|
|
+ } else {
|
|
|
+ message.addEventListener('load', window.scrollTo(0, document.body.scrollHeight - scope.height));
|
|
|
}
|
|
|
- // if (scope.count && angular.element("img").hasClass("lazy")) {
|
|
|
- // angular.element("img.lazy").lazyload({
|
|
|
- // event: "click"
|
|
|
- // });
|
|
|
- // gotoBottom();
|
|
|
- // window.scrollTo(0, document.body.scrollHeight);
|
|
|
- // } else if (scope.count) {
|
|
|
- // gotoBottom();
|
|
|
- // window.scrollTo(0, document.body.scrollHeight);
|
|
|
- // } else
|
|
|
- // angular.element("img.lazy").lazyload({
|
|
|
- // event: "click"
|
|
|
- // });
|
|
|
}
|
|
|
};
|
|
|
/* @ngInject */
|
|
|
@@ -249,7 +232,9 @@
|
|
|
var file = JSON.parse(item);
|
|
|
console.log(JSON.stringify(file));
|
|
|
return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenDirectory', JSON.stringify(file), $scope);
|
|
|
-
|
|
|
+ };
|
|
|
+ $scope.scrollController = function() {
|
|
|
+ window.scrollTo(0, document.body.scrollHeight - $scope.height);
|
|
|
};
|
|
|
}
|
|
|
})();
|