Skip to content

Commit

Permalink
IM示例:增加点击消息列表,关闭键盘的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcui1984 committed Jan 7, 2016
1 parent 6c300c5 commit 23a1474
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/hello-mui/examples/im-chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,25 @@ <h1 class="mui-title">chat (聊天窗口)</h1>
ui.footer.style.height = (ui.h.offsetHeight + footerPadding) + 'px';
ui.content.style.paddingBottom = ui.footer.style.height;
});
var focus = false;
ui.boxMsgText.addEventListener('tap', function(event) {
ui.boxMsgText.focus();
setTimeout(function() {
ui.boxMsgText.focus();
}, 0);
focus = true;
setTimeout(function () {
focus = false;
},1000);
event.detail.gesture.preventDefault();
}, false);
//点击消息列表,关闭键盘
ui.areaMsgList.addEventListener('click',function (event) {
if(!focus){
ui.boxMsgText.blur();
}
})

});
}(mui, document));
</script>
Expand Down

0 comments on commit 23a1474

Please sign in to comment.