onDeviceReady: function() {
app.receivedEvent('deviceready');
/* Calls to `Keyboard` object here */
// setTimeout(function(e){
console.log('set keyboard events');
document.addEventListener('native.keyboardshow', this.keyboardshow, false);
document.addEventListener('native.keyboardhide', this.keyboardhide, false);
// },2000);
*/
},
var app = {
// Application Constructor
initialize: function() {
console.log('init');
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
console.log('set keyboard events');
document.addEventListener('deviceready', this.onDeviceReady, false);
document.addEventListener('native.keyboardshow', this.keyboardshow, false);
document.addEventListener('native.keyboardhide', this.keyboardhide, false);
},
onDeviceReady: function() {
},
keyboardhide:function(){
console.log('hide');
// $(".main-page-footer").addClass('hidediv');
},
keyboardshow:function(){
console.log('show');
// setTimeout(function(){$(".main-page-footer").removeClass('hidediv')},300);
}
}
app.initialize();
function test(){
console.log(native);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
</head>
<body>
<p><button class="help-btn">Help</button></p>
<div class='header'><h1>Directory</h1></div>
<input type="button" onclick="test()" value="test">
<div class='search-view'>
<input class='search-key' type="search" placeholder="Enter name"/>
<ul class='list employee-list'></ul>
</div>
<!--<script src="lib/jquery.js"></script>-->
<!--<script src="js/services/memory/EmployeeService.js"></script>-->
<script src="js/app.js"></script>
</body>
</html>
id="ionic-plugin-keyboard"
version="1.0.8">
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.jim.workshop" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Workshop</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="d...@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>