1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
-
- var app = {
-
- initialize: function() {
- document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
- },
-
-
-
-
-
- onDeviceReady: function() {
-
-
-
- var notchDevices = ["iPhone12,1", "iPhone12,3", "iPhone12,5", "iPhone13,1", "iPhone13,2", "iPhone13,3", "iPhone13,4"]
-
-
- if (ons.platform.isIPhoneX() || notchDevices.includes(device.model)) {
- document.documentElement.setAttribute('onsflag-iphonex-portrait', '');
- document.documentElement.setAttribute('onsflag-iphonex-landscape', '');
- }
-
- },
-
-
- receivedEvent: function(id) {
- var parentElement = document.getElementById(id);
- var listeningElement = parentElement.querySelector('.listening');
- var receivedElement = parentElement.querySelector('.received');
-
- listeningElement.setAttribute('style', 'display:none;');
- receivedElement.setAttribute('style', 'display:block;');
-
- console.log('Received Event: ' + id);
- }
- };
-
- app.initialize();
|