]>
git.proxmox.com Git - sencha-touch.git/blob - src/src/util/sizemonitor/OverflowChange.js
4 Ext
.define('Ext.util.sizemonitor.OverflowChange', {
6 extend
: 'Ext.util.sizemonitor.Abstract',
8 constructor: function(config
) {
9 this.onExpand
= Ext
.Function
.bind(this.onExpand
, this);
10 this.onShrink
= Ext
.Function
.bind(this.onShrink
, this);
12 this.callSuper(arguments
);
15 getElementConfig: function() {
17 reference
: 'detectorsContainer',
18 classList
: ['x-size-monitors', 'overflowchanged'],
21 reference
: 'expandMonitor',
24 reference
: 'expandHelper'
28 reference
: 'shrinkMonitor',
31 reference
: 'shrinkHelper'
38 bindListeners: function(bind
) {
39 var method
= bind
? 'addEventListener' : 'removeEventListener';
41 this.expandMonitor
[method
](Ext
.browser
.is
.Firefox
? 'underflow' : 'overflowchanged', this.onExpand
, true);
42 this.shrinkMonitor
[method
](Ext
.browser
.is
.Firefox
? 'overflow' : 'overflowchanged', this.onShrink
, true);
45 onExpand: function(e
) {
46 if (Ext
.browser
.is
.Webkit
&& e
.horizontalOverflow
&& e
.verticalOverflow
) {
50 Ext
.TaskQueue
.requestRead('refresh', this);
53 onShrink: function(e
) {
54 if (Ext
.browser
.is
.Webkit
&& !e
.horizontalOverflow
&& !e
.verticalOverflow
) {
58 Ext
.TaskQueue
.requestRead('refresh', this);
61 refreshMonitors: function() {
62 if (this.isDestroyed
) {
66 var expandHelper
= this.expandHelper
,
67 shrinkHelper
= this.shrinkHelper
,
68 contentBounds
= this.getContentBounds(),
69 width
= contentBounds
.width
,
70 height
= contentBounds
.height
,
73 if (expandHelper
&& !expandHelper
.isDestroyed
) {
74 style
= expandHelper
.style
;
75 style
.width
= (width
+ 1) + 'px';
76 style
.height
= (height
+ 1) + 'px';
79 if (shrinkHelper
&& !shrinkHelper
.isDestroyed
) {
80 style
= shrinkHelper
.style
;
81 style
.width
= width
+ 'px';
82 style
.height
= height
+ 'px';
85 Ext
.TaskQueue
.requestRead('refresh', this);