Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tower1229 committed Aug 20, 2018
1 parent 13cd1b6 commit fc38bd2
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions sdk/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,29 +89,14 @@ define(function(require, exports, module) {
}
});

// 键盘状态
$.each($('input'), function(i, ele) {
ele.addEventListener('focus', function() {
//输入状态
$body.className = ($body.className + ' onKeyboard');
var kh = $('.keyboardHide');
if (kh.length) {
$.each(kh, function(i, ele) {
ele.setAttribute('displayName', ele.style.display);
ele.style.display = 'none';
});
}

$body[0].classList.add("onKeyboard");
});
ele.addEventListener('blur', function() {
var cacheClass = $body.className;
$body.className = (cacheClass.replace(/\s*onKeyboard/g, ' '));
var kh = $('.keyboardHide');
if (kh.length) {
$.each(kh, function(i, ele) {
var displayName = ele.getAttribute('displayName') || 'block';
ele.style.display = displayName;
});
}
$body[0].classList.remove("onKeyboard");
});
});

Expand Down

0 comments on commit fc38bd2

Please sign in to comment.