1
1
2
2
var POPUP_TPL =
3
- '<div class="popup">' +
4
- '<div class="popup-head">' +
5
- '<h3 class="popup-title" ng-bind-html="title"></h3>' +
6
- '<h5 class="popup-sub-title" ng-bind-html="subTitle" ng-if="subTitle"></h5>' +
7
- '</div>' +
8
- '<div class="popup-body">' +
9
- '</div>' +
10
- '<div class="popup-buttons row">' +
11
- '<button ng-repeat="button in buttons" ng-click="$buttonTapped(button, $event)" class="button col" ng-class="button.type || \'button-default\'" ng-bind-html="button.text"></button>' +
3
+ '<div class="popup-container">' +
4
+ '<div class="popup">' +
5
+ '<div class="popup-head">' +
6
+ '<h3 class="popup-title" ng-bind-html="title"></h3>' +
7
+ '<h5 class="popup-sub-title" ng-bind-html="subTitle" ng-if="subTitle"></h5>' +
8
+ '</div>' +
9
+ '<div class="popup-body">' +
10
+ '</div>' +
11
+ '<div class="popup-buttons">' +
12
+ '<button ng-repeat="button in buttons" ng-click="$buttonTapped(button, $event)" class="button" ng-class="button.type || \'button-default\'" ng-bind-html="button.text"></button>' +
13
+ '</div>' +
12
14
'</div>' +
13
15
'</div>' ;
14
16
@@ -114,7 +116,7 @@ IonicModule
114
116
function ( $ionicTemplateLoader , $ionicBackdrop , $q , $timeout , $rootScope , $document , $compile , $ionicPlatform ) {
115
117
//TODO allow this to be configured
116
118
var config = {
117
- stackPushDelay : 50
119
+ stackPushDelay : 75
118
120
} ;
119
121
var popupStack = [ ] ;
120
122
var $ionicPopup = {
@@ -322,20 +324,8 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $docume
322
324
//if hidden while waiting for raf, don't show
323
325
if ( ! self . isShown ) return ;
324
326
325
- //if the popup is taller than the window, make the popup body scrollable
326
- if ( self . element [ 0 ] . offsetHeight > window . innerHeight - 20 ) {
327
- self . element [ 0 ] . style . height = window . innerHeight - 20 + 'px' ;
328
- popupBody = self . element [ 0 ] . querySelectorAll ( '.popup-body' ) ;
329
- popupHead = self . element [ 0 ] . querySelectorAll ( '.popup-head' ) ;
330
- popupButtons = self . element [ 0 ] . querySelectorAll ( '.popup-buttons' ) ;
331
- self . element . addClass ( 'popup-tall' ) ;
332
- newHeight = window . innerHeight - popupHead [ 0 ] . offsetHeight - popupButtons [ 0 ] . offsetHeight - 20 ;
333
- popupBody [ 0 ] . style . height = newHeight + 'px' ;
334
- }
335
-
336
327
self . element . removeClass ( 'popup-hidden' ) ;
337
328
self . element . addClass ( 'popup-showing active' ) ;
338
- ionic . DomUtil . centerElementByMarginTwice ( self . element [ 0 ] ) ;
339
329
focusInput ( self . element ) ;
340
330
} ) ;
341
331
} ;
@@ -382,6 +372,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $docume
382
372
//Add popup-open & backdrop if this is first popup
383
373
document . body . classList . add ( 'popup-open' ) ;
384
374
$ionicBackdrop . retain ( ) ;
375
+ //only show the backdrop on the first popup
385
376
$ionicPopup . _backButtonActionDone = $ionicPlatform . registerBackButtonAction (
386
377
onHardwareBackButton ,
387
378
PLATFORM_BACK_BUTTON_PRIORITY_POPUP
@@ -408,10 +399,9 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $docume
408
399
} else {
409
400
//Remove popup-open & backdrop if this is last popup
410
401
document . body . classList . remove ( 'popup-open' ) ;
402
+ $ionicBackdrop . release ( ) ;
411
403
( $ionicPopup . _backButtonActionDone || angular . noop ) ( ) ;
412
404
}
413
- // always release the backdrop since it has an internal backdrop counter
414
- $ionicBackdrop . release ( ) ;
415
405
return result ;
416
406
} ) ;
417
407
} ) ;
0 commit comments