diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-09-25 12:06:07 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-09-25 12:06:07 -0400 |
| commit | 00987195f89531e0958a016611ff71776c0b1b6c (patch) | |
| tree | 3752c8693476131bb9a3c32087078b5706e6a705 /www/external | |
| parent | 575c211ea3efc29f846b7b8ea97ea321cc9c49e1 (diff) | |
using updated ion-pullup after ariel merged my changes
Diffstat (limited to 'www/external')
| -rwxr-xr-x[-rw-r--r--] | www/external/ion-pullup.js | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/www/external/ion-pullup.js b/www/external/ion-pullup.js index 5ae5628b..30714d0c 100644..100755 --- a/www/external/ion-pullup.js +++ b/www/external/ion-pullup.js @@ -18,12 +18,7 @@ angular.module('ionic-pullup', []) }, controller: ['$scope', '$element', '$attrs', 'ionPullUpFooterState', 'ionPullUpFooterBehavior', function($scope, $element, $attrs, FooterState, FooterBehavior) { var - tabs = document.querySelector('.tabs'), - hasBottomTabs = document.querySelector('.tabs-bottom'), - header = document.querySelector('.bar-header'), - tabsHeight = tabs ? tabs.offsetHeight : 0, - headerHeight = header ? header.offsetHeight : 0, - handleHeight = 0, + tabs, hasBottomTabs, header, tabsHeight, headerHeight, handleHeight = 0, footer = { height: 0, posY: 0, @@ -36,15 +31,22 @@ angular.module('ionic-pullup', []) }; function init() { - $element.css({ '-webkit-backface-visibility': 'hidden', - 'backface-visibility': 'hidden', - 'transition': '300ms ease-in-out', - 'padding': 0}); + computeDefaultHeights(); + + $element.css({'transition': '300ms ease-in-out', 'padding': 0}); if (tabs && hasBottomTabs) { $element.css('bottom', tabs.offsetHeight + 'px'); } } + function computeDefaultHeights() { + tabs = document.querySelector('.tabs'); + hasBottomTabs = document.querySelector('.tabs-bottom'); + header = document.querySelector('.bar-header'); + tabsHeight = tabs ? tabs.offsetHeight : 0; + headerHeight = header ? header.offsetHeight : 0; + } + function computeHeights() { footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight; $element.css({'height': footer.height + 'px'}); @@ -62,23 +64,16 @@ angular.module('ionic-pullup', []) }, 300); } - function recomputeAllHeights() - { - // PP - Just in time recomputation - tabs = document.querySelector('.tabs'); - hasBottomTabs = document.querySelector('.tabs-bottom'); - header = document.querySelector('.bar-header'); - tabsHeight = tabs ? tabs.offsetHeight : 0; - headerHeight = header ? header.offsetHeight : 0; - footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight; - - } + function recomputeAllHeights() { + computeDefaultHeights(); + footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight; + } function expand() { - //PP - lets recompute height right here to make sure we have the latest - recomputeAllHeights(); + // recompute height right here to make sure we have the latest + recomputeAllHeights(); footer.lastPosY = 0; - //PP - lets adjust CSS values with new heights incase they changed + // adjust CSS values with new heights in case they changed $element.css({'height':footer.height + 'px', '-webkit-transform': 'translate3d(0, 0, 0)', 'transform': 'translate3d(0, 0, 0)'}); $scope.onExpand(); footer.state = FooterState.EXPANDED; @@ -157,12 +152,13 @@ angular.module('ionic-pullup', []) } }; + init(); + $ionicPlatform.ready(function() { $window.addEventListener('orientationchange', updateUI); $ionicPlatform.on("resume", updateUI); }); - init(); }], compile: function(element, attrs) { attrs.defaultHeight && element.css('height', parseInt(attrs.defaultHeight, 10) + 'px'); @@ -227,8 +223,7 @@ angular.module('ionic-pullup', []) left: (($window.innerWidth - width) / 2) + 'px', height: height + 'px', width: width + 'px', - 'text-align': 'center', - + 'text-align': 'center' }); // add gesture |
