Skip to content

Commit

Permalink
fix(refresher): make refresher css not create gap at end of list
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Feb 11, 2014
1 parent 2c7ce76 commit 79387a4
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 4 deletions.
66 changes: 66 additions & 0 deletions js/ext/angular/test/list-fit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

<html ng-app="ionic">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

<title>Sample UL</title>

<link href="../../../../dist/css/ionic.css" rel="stylesheet">
<script src="../../../../dist/js/ionic.bundle.js"></script>
</head>

<body>

<header-bar title="'Sample UL'" type="bar-positive"></header-bar>

<content has-header="true" scroll="true" ng-controller="ContentCtrl" on-refresh="onRefresh()" has-footer="true" padding="false">

<refresher></refresher>

<ul class="list">
<li class="item">This list should *exactly* fit</li>
<li class="item">between header and footer (no gap),</li>
<li class="item">even with pull-to-refresh.</li>
<li class="item">4</li>
<li class="item">5</li>
<li class="item">6</li>
<li class="item">7</li>
<li class="item">8</li>
<li class="item">9</li>
<li class="item">10</li>
<li class="item">11</li>
<li class="item">12</li>
<li class="item">13</li>
<li class="item">14</li>
<li class="item">15</li>
<li class="item">16</li>
<li class="item">17</li>
<li class="item">18</li>
<li class="item">19</li>
<li class="item">20</li>
<li class="item">21</li>
<li class="item">22</li>
<li class="item">23</li>
<li class="item">24</li>
<li class="item">25</li>
<li class="item">26</li>
</ul>
</content>

<footer-bar type="bar-assertive">
<h1 class="title">Footer!</h1>
</footer-bar>

<script>
function ContentCtrl($scope, $timeout) {
$scope.onRefresh = function() {
$timeout(function() {
$scope.$broadcast('scroll.refreshComplete');
}, 1000);
};
}
</script>

</body>
</html>
11 changes: 7 additions & 4 deletions scss/_scaffolding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ body, .ionic-body {
-webkit-user-drag: none;
}

.content {
.content {
// used for content areas not using the content directive
position: relative
position: relative
}

.scroll-content {
Expand Down Expand Up @@ -141,9 +141,12 @@ body, .ionic-body {
// Scroll refresher (for pull to refresh)
.scroll-refresher {
overflow: hidden;
margin-top: -60px;
top: -60px;
height: 60px;
position: relative;
left: 0;
right: 0;
position: absolute;
margin: auto;

.icon-refreshing {
display: none;
Expand Down

0 comments on commit 79387a4

Please sign in to comment.