|
73 | 73 | // "fullscreen" overlay positioning |
74 | 74 | // NOTE - this used to be only "data-fullscreen" on page element. Support both or deprecate page? |
75 | 75 | if( $el.jqmData( "fullscreen" ) || $page.jqmData( "fullscreen" ) ){ |
76 | | - $el.addClass( "ui-" + tbtype + "-fullscreen" ); |
| 76 | + $el.addClass( "ui-"+ tbtype +"-fullscreen" ); |
| 77 | + $page.addClass( "ui-page-" + tbtype + "-fullscreen" ); |
77 | 78 | } |
78 | 79 | // If not fullscreen, add class to page to set top or bottom padding |
79 | 80 | else{ |
|
144 | 145 |
|
145 | 146 | show: function(){ |
146 | 147 | var hideClass = "ui-fixed-hidden", |
147 | | - $el = this.element; |
148 | | - |
149 | | - if( this.options.transition && this.options.transition !== "none" ){ |
| 148 | + $el = this.element, |
| 149 | + scroll = $( window ).scrollTop(), |
| 150 | + elHeight = $el.height(), |
| 151 | + pHeight = $el.closest( ".ui-page" ).height(), |
| 152 | + viewportHeight = Math.min( screen.height, $( window ).height() ), |
| 153 | + tbtype = $el.is( ".ui-header" ) ? "header" : "footer"; |
| 154 | + |
| 155 | + if( this.options.transition && this.options.transition !== "none" && |
| 156 | + ( |
| 157 | + ( tbtype === "header" && !this.options.fullscreen && scroll > elHeight ) || |
| 158 | + ( tbtype === "footer" && !this.options.fullscreen && scroll + viewportHeight < pHeight - elHeight ) |
| 159 | + ) || this.options.fullscreen ){ |
150 | 160 | $el |
151 | 161 | .removeClass( "out " + hideClass ) |
152 | 162 | .addClass( "in" ); |
|
159 | 169 |
|
160 | 170 | hide: function(){ |
161 | 171 | var hideClass = "ui-fixed-hidden", |
162 | | - $el = this.element; |
163 | | - |
164 | | - if( this.options.transition && this.options.transition !== "none" && $( window ).scrollTop() > this.element.height() ){ |
| 172 | + $el = this.element, |
| 173 | + scroll = $( window ).scrollTop(), |
| 174 | + elHeight = $el.height(), |
| 175 | + pHeight = $el.closest( ".ui-page" ).height(), |
| 176 | + viewportHeight = Math.min( screen.height, $( window ).height() ), |
| 177 | + tbtype = $el.is( ".ui-header" ) ? "header" : "footer"; |
| 178 | + |
| 179 | + if( this.options.transition && this.options.transition !== "none" && |
| 180 | + ( |
| 181 | + ( tbtype === "header" && !this.options.fullscreen && scroll > elHeight ) || |
| 182 | + ( tbtype === "footer" && !this.options.fullscreen && scroll + viewportHeight < pHeight - elHeight ) |
| 183 | + ) || this.options.fullscreen ){ |
165 | 184 | $el |
166 | 185 | .removeClass( "in" ) |
167 | 186 | .addClass( "out" ) |
|
0 commit comments