LOTS OF SHIT WOW

This commit is contained in:
Max Lynch
2013-11-13 22:49:54 -06:00
parent 8e585e766c
commit 22d10a155e
33 changed files with 782 additions and 203 deletions

View File

@ -14,7 +14,7 @@ angular.module('ionic.ui.header', ['ngAnimate'])
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
</button>\
</div>\
<h1 class="title" ng-bind="title"></h1>\
<h1 class="title" ng-bind-html="title"></h1>\
<div class="buttons">\
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
</button>\
@ -60,6 +60,24 @@ angular.module('ionic.ui.header', ['ngAnimate'])
});
}
};
})
.directive('footerBar', function() {
return {
restrict: 'E',
replace: true,
transclude: true,
template: '<footer class="bar bar-footer" ng-transclude>\
</footer>',
scope: {
type: '@',
},
link: function($scope, $element, $attr) {
$element.addClass($scope.type);
}
};
});
})(ionic);

View File

@ -27,6 +27,7 @@ angular.module('ionic.ui.content', [])
scope: {
onRefresh: '&',
onRefreshOpening: '&',
refreshComplete: '=',
scroll: '@'
},
compile: function(element, attr, transclude) {
@ -47,9 +48,17 @@ angular.module('ionic.ui.content', [])
c.addClass('has-tabs');
}
// If they want plain overflows scrolling, add that as a class
if(attr.refreshComplete) {
$scope.refreshComplete = function() {
if($scope.scrollView) {
$scope.scrollView.doneRefreshing();
$scope.$parent.$broadcast('scroll.onRefreshComplete');
}
};
}
// If they want plain overflow scrolling, add that as a class
if($scope.scroll === "false") {
// Do nothing for now
} else if(attr.overflowScroll === "true") {
c.addClass('overflow-scroll');
} else {
@ -59,9 +68,11 @@ angular.module('ionic.ui.content', [])
hasPullToRefresh: (typeof $scope.onRefresh !== 'undefined'),
onRefresh: function() {
$scope.onRefresh();
$scope.$parent.$broadcast('scroll.onRefresh');
},
onRefreshOpening: function(amt) {
$scope.onRefreshOpening({amount: amt});
$scope.$parent.$broadcast('scroll.onRefreshOpening', amt);
}
});
// Let child scopes access this
@ -91,14 +102,11 @@ angular.module('ionic.ui.content', [])
icon.style[ionic.CSS.TRANSFORM] = 'scale(' + Math.min((1 + amt), 2) + ')';
}, 100);
$scope.$on('onRefreshing', function(e) {
$scope.$on('scroll.onRefresh', function(e) {
icon.style[ionic.CSS.TRANSFORM] = 'scale(2)';
});
$scope.$on('onRefresh', function(e) {
icon.style[ionic.CSS.TRANSFORM] = 'scale(1)';
});
$scope.$on('onRefreshOpening', onRefreshOpening);
$scope.$on('scroll.onRefreshOpening', onRefreshOpening);
}
}
})

View File

@ -86,7 +86,8 @@ angular.module('ionic.ui.list', ['ngAnimate'])
reorderIcon: '@',
hasPullToRefresh: '@',
onRefresh: '&',
onRefreshOpening: '&'
onRefreshOpening: '&',
refreshComplete: '='
},
controller: function($scope) {
@ -102,26 +103,31 @@ angular.module('ionic.ui.list', ['ngAnimate'])
template: '<ul class="list" ng-class="{\'list-editing\': isEditing}" ng-transclude>\
</ul>',
compile: function(element, attr, transclude) {
return function($scope, $element, $attr) {
var lv = new ionic.views.ListView({
el: $element[0],
listEl: $element[0].children[0],
hasPullToRefresh: ($scope.hasPullToRefresh !== 'false'),
onRefresh: function() {
$scope.onRefresh();
$scope.$parent.$broadcast('scroll.onRefresh');
},
onRefreshOpening: function(amt) {
$scope.onRefreshOpening({amount: amt});
$scope.$parent.$broadcast('scroll.onRefreshOpening', amt);
}
});
if(attr.animation) {
$element.addClass(attr.animation);
link: function($scope, $element, $attr) {
var lv = new ionic.views.ListView({
el: $element[0],
listEl: $element[0].children[0],
hasPullToRefresh: ($scope.hasPullToRefresh !== 'false'),
onRefresh: function() {
$scope.onRefresh();
$scope.$parent.$broadcast('scroll.onRefresh');
},
onRefreshOpening: function(amt) {
$scope.onRefreshOpening({amount: amt});
$scope.$parent.$broadcast('scroll.onRefreshOpening', amt);
}
};
});
if($attr.refreshComplete) {
$scope.refreshComplete = function() {
lv.doneRefreshing();
$scope.$parent.$broadcast('scroll.onRefreshComplete');
};
}
if($attr.animation) {
$element.addClass($attr.animation);
}
}
};
});