diff --git a/index.html b/index.html index 4f6482c..fbb0373 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,7 @@ } - +
@@ -262,8 +262,9 @@ var scrollTop = 0; var click = false; var size = 100;// 每次加载数量 + var tipsIndex = null; - // 添加窗口大小变化的事件监听器 + // 添加窗口大小变化的事件监听器 window.addEventListener('resize', function() { var headContent = document.getElementById("headContent"); var bottomContent = document.getElementById("bottomContent"); @@ -670,13 +671,34 @@ var msgHistory = window.localStorage ? window.localStorage.getItem('msgHistory') : undefined; if(msgHistory){ var items = JSON.parse(msgHistory); - var lis = ''; + var lis = ''; for (var msgHistoryKey in items) { var item = items[msgHistoryKey]; - lis += '
'+item+'
'; + lis += '
'+item+'
'; } console.log(lis) - layer.tips(lis, '#msg',{tips:[3, '#ffffff']}); + var tipsIndex1 = layer.tips(lis, '#msg',{tips:[3, '#ffffff']}); + $("#666").focus(); + $("#666").blur(function() { + layer.close(tipsIndex1); + }); + } + }); + // 消息历史记录单机显示 + $('#msgAdd').on('click', function(){ + var msgHistory = window.localStorage ? window.localStorage.getItem('msgHistory') : undefined; + if(msgHistory){ + var items = JSON.parse(msgHistory); + var lis = ''; + for (var msgHistoryKey in items) { + var item = items[msgHistoryKey]; + lis += '
'+item+'
'; + } + var tipsIndex2 = layer.tips(lis, '#msgAdd',{tips:[3, '#ffffff']}); + $("#666777").focus(); + $("#666777").blur(function() { + layer.close(tipsIndex2); + }); } }); // 线程历史记录单机显示 @@ -684,12 +706,16 @@ var threadHistory = window.localStorage ? window.localStorage.getItem('threadHistory') : undefined; if(threadHistory){ var items = JSON.parse(threadHistory); - var lis = ''; + var lis = ''; for (var msgHistoryKey in items) { var item = items[msgHistoryKey]; lis += '
'+item+'
'; } - layer.tips(lis, '#thread',{tips:[3, '#ffffff']}); + var tipsIndex3 = layer.tips(lis, '#thread',{tips:[3, '#ffffff']}); + $("#666777888").focus(); + $("#666777888").blur(function() { + layer.close(tipsIndex3); + }); } }); } @@ -702,11 +728,11 @@ } layer.closeAll(); }; - function setMsgHistory(index){ + function setMsgHistory(id,index){ var msgHistory = window.localStorage ? window.localStorage.getItem('msgHistory') : undefined; if(msgHistory) { var items = JSON.parse(msgHistory); - $('#msg').val(items[index]+''); + $('#'+id).val(items[index]+''); } layer.closeAll(); };