Skip to content

Commit

Permalink
chore(build): make watch task build all before watch starts
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Apr 1, 2014
1 parent 0db5e85 commit 2a2f657
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ gulp.task('docs', function(done) {
});

var IS_WATCH = false;
gulp.task('watch', ['bundle'], function() {
gulp.task('watch', ['build'], function() {
IS_WATCH = true;
gulp.watch('js/**/*.js', ['bundle']);
gulp.watch('scss/**/*.scss', ['sass']);
Expand Down Expand Up @@ -200,7 +200,7 @@ gulp.task('tweet', function() {
console.log(tweet);
return gulp.src('package.json')
.pipe(twitter(oauth, tweet));
}
}
});

gulp.task('docs-index', function() {
Expand Down
15 changes: 10 additions & 5 deletions js/ext/angular/src/directive/ionicTabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ function($scope, $ionicViewService, $rootScope, $element) {
* @param {expression=} on-deselect Called when this tab is deselected.
* @param {expression=} ng-click By default, the tab will be selected on click. If ngClick is set, it will not. You can explicitly switch tabs using {@link ionic.service:$ionicTabsDelegate#select $ionicTabsDelegate.select()}.
*/
.directive('ionTab', ['$rootScope', '$animate', '$ionicBind', '$compile', '$ionicViewService',
function($rootScope, $animate, $ionicBind, $compile, $ionicViewService) {
.directive('ionTab', ['$rootScope', '$animate', '$ionicBind', '$compile', '$ionicViewService', '$state', '$location',
function($rootScope, $animate, $ionicBind, $compile, $ionicViewService, $state, $location) {

//Returns ' key="value"' if value exists
function attrStr(k,v) {
Expand Down Expand Up @@ -372,9 +372,14 @@ function($rootScope, $animate, $ionicBind, $compile, $ionicViewService) {
});

function selectTabIfMatchesState() {
// this tab's ui-view is the current one, go to it!
if ($ionicViewService.isCurrentStateNavView($scope.navViewName)) {
tabsCtrl.select($scope);
var href = $attr.href.replace(/^#/, '');
var stateName = $attr.uiSref.split('(')[0];

if ($location.path().indexOf(href) === 0 || $state.includes(stateName)) {
// this tab's ui-view is the current one, go to it!
if ($ionicViewService.isCurrentStateNavView($scope.navViewName)) {
tabsCtrl.select($scope);
}
}
}
};
Expand Down

0 comments on commit 2a2f657

Please sign in to comment.