Skip to content

Commit 06f4ec8

Browse files
committed
fixed the popover height issue - thank you to sven! very much appreciated
1 parent 586b4ff commit 06f4ec8

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

experiments/splitview/jquery.mobile.splitview.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,17 @@
7777
return pageMin;
7878
}
7979

80-
function resetActivePageHeight(){
81-
$( "." + $.mobile.activePageClass ).css( "min-height", getScreenHeight() );
80+
function newResetActivePageHeight(){
81+
var page=$( "." + $.mobile.activePageClass );
82+
page.each(function(){
83+
if($(this).closest(".panel-popover").length != 1){
84+
$(this).css("min-height", getScreenHeight());
85+
}
86+
else {
87+
$(this).css("min-height", "100%")
88+
}
89+
});
90+
8291
}
8392

8493
//override _registerInternalEvents to bind to new methods below
@@ -386,8 +395,8 @@
386395

387396

388397
//set page min-heights to be device specific
389-
$( document ).bind( "pageshow.resetPageHeight", resetActivePageHeight );
390-
$( window ).bind( "throttledresize.resetPageHeight", resetActivePageHeight );
398+
$( document ).bind( "pageshow.resetPageHeight", newResetActivePageHeight );
399+
$( window ).bind( "throttledresize.resetPageHeight", newResetActivePageHeight );
391400

392401
}; //end _registerInternalEvents
393402

@@ -425,6 +434,7 @@
425434
if(!$menu.children('.popover_triangle').length){
426435
$menu.prepend('<div class="popover_triangle"></div>');
427436
}
437+
$menu.children('.' + $.activePageClass).css('min-height', '100%');
428438
$main.removeClass('ui-panel-right')
429439
.css('width', '');
430440
popoverBtn($mainHeader);
@@ -435,9 +445,7 @@
435445
popoverBtn($thisHeader);
436446
});
437447
// TODO: unbind resetActivePageHeight for popover pages
438-
$( document ).unbind('pageshow.resetPageHeight');
439-
$( window ).unbind('throttledresize.resetPageHeight');
440-
$main.bind('pageshow', resetActivePageHeight );
448+
441449
};
442450

443451
function splitView(){

0 commit comments

Comments
 (0)