]>
git.proxmox.com Git - extjs.git/blob - extjs/modern/modern/src/viewport/WindowsPhone.js
3 * Windows Phone version of Viewport.
5 Ext
.define('Ext.viewport.WindowsPhone', {
8 alternateClassName
: 'Ext.viewport.WP',
10 extend
: 'Ext.viewport.Default',
12 // so one pixel line is displayed on the right side of the screen. Setting width more than 100% fix the issue
20 translationMethod
: 'csstransform'
24 initialize: function () {
25 // There is -ms-user-select CSS property for IE10, but it seems it works only in desktop browser. So we need to prevent selection event.
26 var preventSelection = function(e
) {
27 var srcElement
= e
.srcElement
.nodeName
.toUpperCase(),
28 selectableElements
= ['INPUT', 'TEXTAREA'];
30 if (selectableElements
.indexOf(srcElement
) == -1) {
35 document
.body
.addEventListener('onselectstart', preventSelection
);
37 this.addMeta('msapplication-tap-highlight', 'no');
42 supportsOrientation: function() {
46 onResize: function() {
47 this.waitUntil(function() {
48 var oldWidth
= this.windowWidth
,
49 oldHeight
= this.windowHeight
,
50 width
= this.getWindowWidth(),
51 height
= this.getWindowHeight(),
52 currentOrientation
= this.getOrientation(),
53 newOrientation
= this.determineOrientation();
55 return ((oldWidth
!== width
&& oldHeight
!== height
) && currentOrientation
!== newOrientation
);
57 var currentOrientation
= this.getOrientation(),
58 newOrientation
= this.determineOrientation();
59 this.fireOrientationChangeEvent(newOrientation
, currentOrientation
);