chore(build): make watch task build all before watch starts

This commit is contained in:
Andy Joslin
2014-04-01 07:27:25 -06:00
parent 0db5e85266
commit 2a2f657eaf
2 changed files with 12 additions and 7 deletions

View File

@@ -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']);
@@ -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() {

View File

@@ -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) {
@@ -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);
}
}
}
};