Skip to content

Commit 64b98be

Browse files
committed
chore(): prepare for 0.9.27 - last alpha release
1 parent 4427e87 commit 64b98be

File tree

12 files changed

+746
-1009
lines changed

12 files changed

+746
-1009
lines changed

gulpfile.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var _ = require('lodash');
22
var buildConfig = require('./config/build.config.js');
3+
var changelog = require('conventional-changelog');
34
var connect = require('connect');
45
var dgeni = require('dgeni');
56
var http = require('http');
@@ -56,8 +57,15 @@ gulp.task('watch', function() {
5657
gulp.watch('scss/**/*.scss', ['sass']);
5758
});
5859

59-
gulp.task('changelog', function() {
60-
gutil.log(gutil.colors.red('TODO: Add working changelog task'));
60+
gulp.task('changelog', function(done) {
61+
changelog({
62+
repository: pkg.repository.url,
63+
version: pkg.version,
64+
}, function(err, data) {
65+
if (err) return done(err);
66+
require('fs').writeFileSync('CHANGELOG.md', data);
67+
done();
68+
});
6169
});
6270

6371
gulp.task('bundle', [

js/ext/angular/src/directive/ionicBar.js

Lines changed: 91 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -18,100 +18,108 @@ angular.module('ionic.ui.header', ['ngAnimate', 'ngSanitize'])
1818
* @name ionHeaderBar
1919
* @module ionic
2020
* @restrict E
21-
* @group page layout
22-
* @controller ionicBar
23-
*
2421
* @description
25-
* Adds a fixed header bar above some content.
22+
* While Ionic provides simple Header and Footer bars that can be created through
23+
* HTML and CSS alone, Header bars specifically can be extended in order to
24+
* provide dynamic layout features such as auto-title centering and animation.
25+
* They are also used by the Views and Navigation Controller to animate a title
26+
* on navigation and toggle a back button.
27+
*
28+
* The main header bar feature provided is auto title centering.
29+
* In this situation, the title text will center itself until either the
30+
* left or right button content is too wide for the label to center.
31+
* In that case, it will slide left or right until it can fit.
32+
* You can also align the title left for a more Android-friendly header.
2633
*
27-
* Is able to have left or right buttons, and additionally its title can be
28-
* aligned through the {@link ionic.controller:ionicBar ionicBar controller}.
34+
* Using two-way data binding, the header bar will automatically
35+
* readjust the heading title alignment when the title or buttons change.
2936
*
30-
* @param {string=} model The model to assign this headerBar's
31-
* {@link ionic.controller:ionicBar ionicBar controller} to.
32-
* Defaults to assigning to $scope.headerBarController.
33-
* @param {string=} align-title Where to align the title at the start.
34-
* Avaialble: 'left', 'right', or 'center'. Defaults to 'center'.
37+
* @param {string} title The title use on the headerBar.
38+
* @param {expression=} leftButtons Point to an array of buttons to put on the left of the bar.
39+
* @param {expression=} rightButtons Point to an array of buttons to put on the right of the bar.
40+
* @param {string=} type The type of the bar, for example 'bar-positive'.
41+
* @param {string=} align Where to align the title. 'left', 'right', or 'center'. Defaults to 'center'.
3542
*
3643
* @usage
3744
* ```html
38-
* <ion-header-bar align-title="left">
39-
* <div class="buttons">
40-
* <button class="button">Left Button</button>
41-
* </div>
42-
* <h1 class="title">Title!</h1>
43-
* <div class="buttons">
44-
* <button class="button">Right Button</button>
45-
* </div>
45+
* <ion-header-bar
46+
* title="{{myTitle}}"
47+
* left-buttons="leftButtons"
48+
* right-buttons="rightButtons"
49+
* type="bar-positive"
50+
* align-title="center">
4651
* </ion-header-bar>
47-
* <ion-content>
48-
* Some content!
49-
* </ion-content>
5052
* ```
51-
*/
52-
.directive('ionHeaderBar', barDirective(true))
53-
54-
/**
55-
* @ngdoc directive
56-
* @name ionFooterBar
57-
* @module ionic
58-
* @restrict E
59-
* @group page layout
60-
* @controller ionicBar
6153
*
62-
* @description
63-
* Adds a fixed footer bar below some content.
64-
*
65-
* Is able to have left or right buttons, and additionally its title can be
66-
* aligned through the {@link ionic.controller:ionicBar ionicBar controller}.
67-
*
68-
* @param {string=} model The model to assign this footerBar's
69-
* {@link ionic.controller:ionicBar ionicBar controller} to.
70-
* Defaults to assigning to $scope.footerBarController.
71-
* @param {string=} align-title Where to align the title at the start.
72-
* Avaialble: 'left', 'right', or 'center'. Defaults to 'center'.
73-
*
74-
* @usage
75-
* ```html
76-
* <ion-content>
77-
* Some content!
78-
* </ion-content>
79-
* <ion-footer-bar align-title="left">
80-
* <div class="buttons">
81-
* <button class="button">Left Button</button>
82-
* </div>
83-
* <h1 class="title">Title!</h1>
84-
* <div class="buttons">
85-
* <button class="button">Right Button</button>
86-
* </div>
87-
* </ion-footer-bar>
88-
* ```
8954
*/
90-
.directive('ionFooterBar', barDirective(false));
55+
.directive('ionHeaderBar', ['$ionicScrollDelegate', function($ionicScrollDelegate) {
56+
return {
57+
restrict: 'E',
58+
replace: true,
59+
transclude: true,
60+
template: '<header class="bar bar-header">\
61+
<div class="buttons">\
62+
<button ng-repeat="button in leftButtons" class="button no-animation" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
63+
</button>\
64+
</div>\
65+
<h1 class="title" ng-bind-html="title"></h1>\
66+
<div class="buttons">\
67+
<button ng-repeat="button in rightButtons" class="button no-animation" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
68+
</button>\
69+
</div>\
70+
</header>',
9171

92-
function barDirective(isHeader) {
93-
var BAR_TEMPLATE = isHeader ?
94-
'<header class="bar bar-header" ng-transclude></header>' :
95-
'<footer class="bar bar-header" ng-transclude></footer>';
96-
var BAR_MODEL_DEFAULT = isHeader ?
97-
'headerBarController' :
98-
'footerBarController';
99-
return ['$parse', function($parse) {
100-
return {
101-
restrict: 'E',
102-
replace: true,
103-
transclude: true,
104-
template: BAR_TEMPLATE,
105-
link: function($scope, $element, $attr) {
106-
var hb = new ionic.views.HeaderBar({
107-
el: $element[0],
108-
alignTitle: $attr.alignTitle || 'center'
109-
});
72+
scope: {
73+
leftButtons: '=',
74+
rightButtons: '=',
75+
title: '@',
76+
type: '@',
77+
alignTitle: '@'
78+
},
79+
link: function($scope, $element, $attr) {
80+
var hb = new ionic.views.HeaderBar({
81+
el: $element[0],
82+
alignTitle: $scope.alignTitle || 'center'
83+
});
84+
85+
$element.addClass($scope.type);
86+
87+
$scope.headerBarView = hb;
88+
89+
$scope.$watchCollection('leftButtons', function(val) {
90+
// Resize the title since the buttons have changed
91+
hb.align();
92+
});
11093

111-
$parse($attr.model || BAR_MODEL_DEFAULT).assign($scope.$parent, hb);
112-
}
113-
};
114-
}];
115-
}
94+
$scope.$watchCollection('rightButtons', function(val) {
95+
// Resize the title since the buttons have changed
96+
hb.align();
97+
});
98+
99+
$scope.$watch('title', function(val) {
100+
// Resize the title since the title has changed
101+
hb.align();
102+
});
103+
}
104+
};
105+
}])
106+
107+
.directive('ionFooterBar', function() {
108+
return {
109+
restrict: 'E',
110+
replace: true,
111+
transclude: true,
112+
template: '<footer class="bar bar-footer" ng-transclude>\
113+
</footer>',
114+
115+
scope: {
116+
type: '@',
117+
},
118+
119+
link: function($scope, $element, $attr) {
120+
$element.addClass($scope.type);
121+
}
122+
};
123+
});
116124

117125
})(ionic);

0 commit comments

Comments
 (0)