Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit fee3bab

Browse files
committed
Helpers: Remove deprecated $.mobile.getScreenHeight
Fixes gh-6306 Closes gh-8181
1 parent 303c531 commit fee3bab

File tree

9 files changed

+8
-20
lines changed

9 files changed

+8
-20
lines changed

demos/_assets/js/view-source.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ $( document )
220220
.on( "popupbeforeposition", ".jqm-view-source", function() {
221221
// max height: screen height - tolerance (2*30px) - 42px for each collapsible heading
222222
var x = $( this ).find( ".ui-collapsible" ).length,
223-
maxHeight = $.mobile.getScreenHeight() - 60 - ( x * 42 );
223+
maxHeight = $( window ).height() - 60 - ( x * 42 );
224224

225225
$( this ).find( ".ui-collapsible-content" ).css( "max-height", maxHeight + "px" );
226226

js/defaults.js

-12
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,6 @@ return $.extend( $.mobile, {
3434
// Keepnative Selector
3535
keepNative: ":jqmData(role='none'), :jqmData(role='nojs')",
3636

37-
// Deprecated in 1.4 remove in 1.5
38-
// Class assigned to page currently in view, and during transitions
39-
activePageClass: "ui-page-active",
40-
41-
// Deprecated in 1.4 remove in 1.5
42-
// Class used for "active" button state, from CSS framework
43-
activeBtnClass: "ui-button-active",
44-
45-
// Deprecated in 1.4 remove in 1.5
46-
// Class used for "focus" form element state, from CSS framework
47-
focusClass: "ui-focus",
48-
4937
// Automatically handle clicks and form submissions through Ajax, when same-domain
5038
ajaxEnabled: true,
5139

js/helpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ $.extend( $.mobile, {
227227
pageOuterHeight = page.outerHeight( true );
228228

229229
height = compensateToolbars( page,
230-
( typeof height === "number" ) ? height : $.mobile.getScreenHeight() );
230+
( typeof height === "number" ) ? height : $( window ).height() );
231231

232232
// Remove any previous min-height setting
233233
page.css( "min-height", "" );

js/transitions/handlers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
// generate the handlers from the above
3232
var defaultGetMaxScrollForTransition = function() {
33-
return $.mobile.getScreenHeight() * 3;
33+
return $( window ).height() * 3;
3434
};
3535

3636
//transition handler dictionary for 3rd party transitions

js/transitions/transition.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ $.extend( $.mobile.Transition.prototype, {
161161
// it is today. So we wait until transition is invoked to gather the following
162162
var none,
163163
reverseClass = this.reverse ? " reverse" : "",
164-
screenHeight = $.mobile.getScreenHeight(),
164+
screenHeight = $( window ).height(),
165165
maxTransitionOverride = $.mobile.maxTransitionWidth !== false &&
166166
$.mobile.window.width() > $.mobile.maxTransitionWidth;
167167

js/widgets/fixedToolbar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ return $.widget( "mobile.toolbar", $.mobile.toolbar, {
200200
scroll = $win.scrollTop(),
201201
elHeight = $el.height(),
202202
pHeight = ( !!this.page ) ? $el.closest( ".ui-page" ).height() : $( ".ui-page-active" ).height(),
203-
viewportHeight = $.mobile.getScreenHeight();
203+
viewportHeight = this.window.height();
204204

205205
return !notransition &&
206206
( this.options.transition && this.options.transition !== "none" &&

js/widgets/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ return $.widget( "mobile.loader", {
7575
checkLoaderPosition: function() {
7676
var offset = this.element.offset(),
7777
scrollTop = this.window.scrollTop(),
78-
screenHeight = $.mobile.getScreenHeight();
78+
screenHeight = this.window.height();
7979

8080
if ( offset.top < scrollTop || ( offset.top - scrollTop ) > screenHeight ) {
8181
this.element.addClass( "ui-loader-fakefix" );

js/widgets/panel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ return $.widget( "mobile.panel", {
187187
var heightWithMargins, heightWithoutMargins,
188188
self = this,
189189
panelInnerHeight = self._panelInner.outerHeight(),
190-
expand = panelInnerHeight > $.mobile.getScreenHeight();
190+
expand = panelInnerHeight > this.window.height();
191191

192192
if ( expand || !self.options.positionFixed ) {
193193
if ( expand ) {

tests/integration/panel/external_panel_core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ $.testHelper.detailedEventCascade( [
6868
"Successfully changed to page '#panel-stretch-page'" );
6969

7070
// Make the page scroll
71-
$( "#panel-stretch-page .ui-content" ).height( $.mobile.getScreenHeight() * 3 );
71+
$( "#panel-stretch-page .ui-content" ).height( $( window ).height() * 3 );
7272

7373
stretchTestPanel.panel( "open" );
7474
},

0 commit comments

Comments
 (0)