summaryrefslogtreecommitdiff
path: root/www/lib/ionic-pullup
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-04-10 10:47:35 -0400
committerpliablepixels <pliablepixels@gmail.com>2016-04-10 10:47:35 -0400
commita29f9a676a6ea3bad56ede05cd1a1c82ffbbe8e9 (patch)
tree7e6e6bfb23390a64344fdfe2272a5da04c2dd97c /www/lib/ionic-pullup
parent42bc21f7d0b4acfeefa5f4c2708203be78f57778 (diff)
#219 - everything upgraded
Former-commit-id: 15f58d10df83feda8199a1b904433e625ef36b44
Diffstat (limited to 'www/lib/ionic-pullup')
-rw-r--r--www/lib/ionic-pullup/.bower.json13
-rw-r--r--www/lib/ionic-pullup/CHANGELOG.md3
-rw-r--r--www/lib/ionic-pullup/bower.json2
-rw-r--r--www/lib/ionic-pullup/dist/ion-pullup.js63
-rw-r--r--www/lib/ionic-pullup/example/www/js/ion-pullup.js61
-rw-r--r--www/lib/ionic-pullup/package.json2
6 files changed, 95 insertions, 49 deletions
diff --git a/www/lib/ionic-pullup/.bower.json b/www/lib/ionic-pullup/.bower.json
index 3db1e838..c58f829a 100644
--- a/www/lib/ionic-pullup/.bower.json
+++ b/www/lib/ionic-pullup/.bower.json
@@ -1,21 +1,20 @@
{
"name": "ionic-pullup",
"description": "Ionic pull up footer",
- "version": "1.0.2",
+ "version": "1.0.3",
"homepage": "https://github.com/arielfaur",
"license": "MIT",
"private": false,
"devDependencies": {
"ionic": "~1.0.x"
},
- "_release": "1.0.2",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.2",
- "commit": "a7b943729c363d736df346a92d26f5c4f20661ee"
+ "tag": "v1.0.3",
+ "commit": "1124274a57ac0ff7ecc8377a3703fb8e9c350815"
},
- "_source": "git://github.com/arielfaur/ionic-pullup.git",
+ "_source": "https://github.com/arielfaur/ionic-pullup.git",
"_target": "~1.0.2",
- "_originalSource": "ionic-pullup",
- "_direct": true
+ "_originalSource": "ionic-pullup"
} \ No newline at end of file
diff --git a/www/lib/ionic-pullup/CHANGELOG.md b/www/lib/ionic-pullup/CHANGELOG.md
index db8c9db9..f7f22dcc 100644
--- a/www/lib/ionic-pullup/CHANGELOG.md
+++ b/www/lib/ionic-pullup/CHANGELOG.md
@@ -1,3 +1,6 @@
+# v1.0.3
+Fixes issue #1 where component height was wrong after changing device orientation
+
# v1.0.2
## Breaking change
diff --git a/www/lib/ionic-pullup/bower.json b/www/lib/ionic-pullup/bower.json
index f98158c4..debdd33d 100644
--- a/www/lib/ionic-pullup/bower.json
+++ b/www/lib/ionic-pullup/bower.json
@@ -1,7 +1,7 @@
{
"name": "ionic-pullup",
"description": "Ionic pull up footer",
- "version": "1.0.2",
+ "version": "1.0.3",
"homepage": "https://github.com/arielfaur",
"license": "MIT",
"private": false,
diff --git a/www/lib/ionic-pullup/dist/ion-pullup.js b/www/lib/ionic-pullup/dist/ion-pullup.js
index c82cdc3d..30714d0c 100644
--- a/www/lib/ionic-pullup/dist/ion-pullup.js
+++ b/www/lib/ionic-pullup/dist/ion-pullup.js
@@ -8,7 +8,7 @@ angular.module('ionic-pullup', [])
HIDE: 'HIDE',
EXPAND: 'EXPAND'
})
- .directive('ionPullUpFooter', ['$timeout', '$rootScope', '$window', function($timeout, $rootScope, $window) {
+ .directive('ionPullUpFooter', ['$timeout', '$rootScope', '$window', '$ionicPlatform', function($timeout, $rootScope, $window, $ionicPlatform) {
return {
restrict: 'AE',
scope: {
@@ -17,14 +17,8 @@ angular.module('ionic-pullup', [])
onMinimize: '&'
},
controller: ['$scope', '$element', '$attrs', 'ionPullUpFooterState', 'ionPullUpFooterBehavior', function($scope, $element, $attrs, FooterState, FooterBehavior) {
- console.log ("***********ARC ************"+$attrs.maxHeight);
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,
@@ -37,15 +31,24 @@ 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() {
- // PP
- footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight -20;
+ footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight;
$element.css({'height': footer.height + 'px'});
if (footer.initialState == FooterState.MINIMIZED) {
@@ -55,9 +58,23 @@ angular.module('ionic-pullup', [])
}
}
+ function updateUI() {
+ $timeout(function() {
+ computeHeights();
+ }, 300);
+ }
+
+ function recomputeAllHeights() {
+ computeDefaultHeights();
+ footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight;
+ }
+
function expand() {
+ // recompute height right here to make sure we have the latest
+ recomputeAllHeights();
footer.lastPosY = 0;
- $element.css({'-webkit-transform': 'translate3d(0, 0, 0)', 'transform': 'translate3d(0, 0, 0)'});
+ // 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;
}
@@ -135,13 +152,13 @@ angular.module('ionic-pullup', [])
}
};
- $window.addEventListener('orientationchange', function() {
- $timeout(function() {
- computeHeights();
- }, 500);
+ 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');
@@ -187,7 +204,7 @@ angular.module('ionic-pullup', [])
}
}
}])
- .directive('ionPullUpHandle', ['$ionicGesture', '$timeout', '$window', function($ionicGesture, $timeout, $window) {
+ .directive('ionPullUpHandle', ['$ionicGesture', '$ionicPlatform', '$timeout', '$window', function($ionicGesture, $ionicPlatform, $timeout, $window) {
return {
restrict: 'AE',
require: '^ionPullUpFooter',
@@ -206,7 +223,6 @@ angular.module('ionic-pullup', [])
left: (($window.innerWidth - width) / 2) + 'px',
height: height + 'px',
width: width + 'px',
- //margin: '0 auto',
'text-align': 'center'
});
@@ -218,10 +234,15 @@ angular.module('ionic-pullup', [])
element.find('i').toggleClass(toggleClasses);
});
- $window.addEventListener('orientationchange', function() {
+ function updateUI() {
$timeout(function() {
element.css('left', (($window.innerWidth - width) / 2) + 'px');
- }, 500);
+ }, 300);
+ }
+
+ $ionicPlatform.ready(function() {
+ $window.addEventListener('orientationchange', updateUI);
+ $ionicPlatform.on("resume", updateUI);
});
}
}
diff --git a/www/lib/ionic-pullup/example/www/js/ion-pullup.js b/www/lib/ionic-pullup/example/www/js/ion-pullup.js
index c558cb93..30714d0c 100644
--- a/www/lib/ionic-pullup/example/www/js/ion-pullup.js
+++ b/www/lib/ionic-pullup/example/www/js/ion-pullup.js
@@ -8,7 +8,7 @@ angular.module('ionic-pullup', [])
HIDE: 'HIDE',
EXPAND: 'EXPAND'
})
- .directive('ionPullUpFooter', ['$timeout', '$rootScope', '$window', function($timeout, $rootScope, $window) {
+ .directive('ionPullUpFooter', ['$timeout', '$rootScope', '$window', '$ionicPlatform', function($timeout, $rootScope, $window, $ionicPlatform) {
return {
restrict: 'AE',
scope: {
@@ -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,12 +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'});
@@ -53,9 +58,23 @@ angular.module('ionic-pullup', [])
}
}
+ function updateUI() {
+ $timeout(function() {
+ computeHeights();
+ }, 300);
+ }
+
+ function recomputeAllHeights() {
+ computeDefaultHeights();
+ footer.height = footer.maxHeight > 0 ? footer.maxHeight : $window.innerHeight - headerHeight - handleHeight - tabsHeight;
+ }
+
function expand() {
+ // recompute height right here to make sure we have the latest
+ recomputeAllHeights();
footer.lastPosY = 0;
- $element.css({'-webkit-transform': 'translate3d(0, 0, 0)', 'transform': 'translate3d(0, 0, 0)'});
+ // 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;
}
@@ -133,13 +152,13 @@ angular.module('ionic-pullup', [])
}
};
- $window.addEventListener('orientationchange', function() {
- $timeout(function() {
- computeHeights();
- }, 500);
+ 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');
@@ -185,7 +204,7 @@ angular.module('ionic-pullup', [])
}
}
}])
- .directive('ionPullUpHandle', ['$ionicGesture', '$timeout', '$window', function($ionicGesture, $timeout, $window) {
+ .directive('ionPullUpHandle', ['$ionicGesture', '$ionicPlatform', '$timeout', '$window', function($ionicGesture, $ionicPlatform, $timeout, $window) {
return {
restrict: 'AE',
require: '^ionPullUpFooter',
@@ -204,7 +223,6 @@ angular.module('ionic-pullup', [])
left: (($window.innerWidth - width) / 2) + 'px',
height: height + 'px',
width: width + 'px',
- //margin: '0 auto',
'text-align': 'center'
});
@@ -216,11 +234,16 @@ angular.module('ionic-pullup', [])
element.find('i').toggleClass(toggleClasses);
});
- $window.addEventListener('orientationchange', function() {
+ function updateUI() {
$timeout(function() {
element.css('left', (($window.innerWidth - width) / 2) + 'px');
- }, 500);
+ }, 300);
+ }
+
+ $ionicPlatform.ready(function() {
+ $window.addEventListener('orientationchange', updateUI);
+ $ionicPlatform.on("resume", updateUI);
});
}
}
- }]); \ No newline at end of file
+ }]);
diff --git a/www/lib/ionic-pullup/package.json b/www/lib/ionic-pullup/package.json
index 0bbe67fa..cb3e81d9 100644
--- a/www/lib/ionic-pullup/package.json
+++ b/www/lib/ionic-pullup/package.json
@@ -1,7 +1,7 @@
{
"name": "ionic-pullup",
"private": false,
- "version": "1.0.2",
+ "version": "1.0.3",
"description": "Ionic pull up footer",
"repository": "https://github.com/arielfaur",
"license": "MIT",