docs: simplify apis where possible

This commit is contained in:
Andy Joslin
2014-03-17 11:56:21 -06:00
parent 5e865962b0
commit 6662f6effd
4 changed files with 5 additions and 22 deletions

View File

@@ -25,7 +25,6 @@ angular.module('ionic.ui.header', ['ngAnimate', 'ngSanitize'])
* Is able to have left or right buttons, and additionally its title can be
* aligned through the {@link ionic.controller:ionicBar ionicBar controller}.
*
* @param {string=} type The type of the bar. For example 'bar-positive'.
* @param {string=} model The model to assign this headerBar's
* {@link ionic.controller:ionicBar ionicBar controller} to.
* Defaults to assigning to $scope.headerBarController.
@@ -34,7 +33,7 @@ angular.module('ionic.ui.header', ['ngAnimate', 'ngSanitize'])
*
* @usage
* ```html
* <ion-header-bar align-title="left">
* <ion-header-bar align-title="left" class="bar-positive">
* <div class="buttons">
* <button class="button">Left Button</button>
* </div>
@@ -63,7 +62,6 @@ angular.module('ionic.ui.header', ['ngAnimate', 'ngSanitize'])
* Is able to have left or right buttons, and additionally its title can be
* aligned through the {@link ionic.controller:ionicBar ionicBar controller}.
*
* @param {string=} type The type of the bar. For example 'bar-positive'.
* @param {string=} model The model to assign this footerBar's
* {@link ionic.controller:ionicBar ionicBar controller} to.
* Defaults to assigning to $scope.footerBarController.
@@ -75,7 +73,7 @@ angular.module('ionic.ui.header', ['ngAnimate', 'ngSanitize'])
* <ion-content>
* Some content!
* </ion-content>
* <ion-footer-bar align-title="left">
* <ion-footer-bar align-title="left" class="bar-assertive">
* <div class="buttons">
* <button class="button">Left Button</button>
* </div>
@@ -108,11 +106,6 @@ function barDirective(isHeader) {
});
$parse($attr.model || BAR_MODEL_DEFAULT).assign($scope.$parent || $scope, hb);
$attr.$observe('type', function(val, oldVal) {
oldVal && $element.removeClass(oldVal);
$element.addClass(val);
});
}
};
}];

View File

@@ -68,7 +68,7 @@ function($parse, $timeout, $controller, $ionicBind) {
require: '^?ionNavView',
scope: true,
template:
'<div class="scroll-content" ng-class="$$contentState.getClassName()">' +
'<div class="scroll-content">' +
'<div class="scroll"></div>' +
'</div>',
compile: function(element, attr, transclude) {

View File

@@ -193,7 +193,7 @@ function($scope, $element, $ionicViewService, $animate, $compile) {
* <!-- The nav bar that will be updated as we navigate -->
* <ion-nav-bar
* animation="nav-title-slide-ios7"
* type="bar-positive"></ion-nav-bar>
* class="bar-positive"></ion-nav-bar>
*
* <!-- where the initial view template will be rendered -->
* <ion-nav-view animation="slide-left-right"></ion-nav-view>
@@ -204,7 +204,6 @@ function($scope, $element, $ionicViewService, $animate, $compile) {
* {@link ionic.controller:ionicNavBar ionicNavBar controller} to.
* Default: assigns it to $scope.navBarController.
* @param animation {string=} The animation used to transition between titles.
* @param type {string=} The className for the navbar. For example, 'bar-positive'.
* @param align {string=} Where to align the title of the navbar.
* Available: 'left', 'right', 'center'. Defaults to 'center'.
*/
@@ -218,7 +217,6 @@ function($ionicViewService, $rootScope, $animate, $compile, $parse) {
controller: '$ionicNavBar',
scope: {
animation: '@',
type: '@',
alignTitle: '@'
},
template:
@@ -246,8 +244,7 @@ function($ionicViewService, $rootScope, $animate, $compile, $parse) {
$scope.isInvisible = true;
$scope.navBarClass = function() {
return ($scope.type ? ' ' + $scope.type : '') +
($scope.isReverse ? ' reverse' : '') +
return ($scope.isReverse ? ' reverse' : '') +
($scope.isInvisible ? ' invisible' : '') +
($scope.shouldAnimate && $scope.animation ? ' ' + $scope.animation : '');
};

View File

@@ -267,12 +267,5 @@ describe('ionNavBar', function() {
el.isolateScope().$apply('isReverse = false');
expect(el.hasClass('reverse')).toBe(false);
});
it('should have type class', function() {
var el = setup();
expect(el.hasClass('superbar')).toBe(false);
el.isolateScope().$apply('type = "superbar"');
expect(el.hasClass('superbar')).toBe(true);
});
});
});