Commit 23a14741 authored by hbcui1984's avatar hbcui1984

IM示例:增加点击消息列表,关闭键盘的功能

parent 6c300c54
...@@ -670,12 +670,25 @@ ...@@ -670,12 +670,25 @@
ui.footer.style.height = (ui.h.offsetHeight + footerPadding) + 'px'; ui.footer.style.height = (ui.h.offsetHeight + footerPadding) + 'px';
ui.content.style.paddingBottom = ui.footer.style.height; ui.content.style.paddingBottom = ui.footer.style.height;
}); });
var focus = false;
ui.boxMsgText.addEventListener('tap', function(event) { ui.boxMsgText.addEventListener('tap', function(event) {
ui.boxMsgText.focus(); ui.boxMsgText.focus();
setTimeout(function() { setTimeout(function() {
ui.boxMsgText.focus(); ui.boxMsgText.focus();
}, 0); }, 0);
focus = true;
setTimeout(function () {
focus = false;
},1000);
event.detail.gesture.preventDefault();
}, false); }, false);
//点击消息列表,关闭键盘
ui.areaMsgList.addEventListener('click',function (event) {
if(!focus){
ui.boxMsgText.blur();
}
})
}); });
}(mui, document)); }(mui, document));
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment