Merge branch 'master' into overlay-refactor

This commit is contained in:
Adam Bradley
2015-12-22 21:55:24 -06:00
4 changed files with 39 additions and 17 deletions

View File

@ -397,7 +397,7 @@ gulp.task('src', function(done){
); );
}) })
gulp.task('publish', ['src'], function(done){ gulp.task('package', ['src'], function(done){
var _ = require('lodash'); var _ = require('lodash');
var fs = require('fs'); var fs = require('fs');
var distDir = 'dist'; var distDir = 'dist';
@ -414,7 +414,7 @@ gulp.task('publish', ['src'], function(done){
{ {
type: 'input', type: 'input',
name: 'ionicVersion', name: 'ionicVersion',
message: '\n\n\nWhat ionic-framework alpha version number will this be?' message: '\n\nWhat ionic-framework alpha version number will this be?'
}, },
{ {
type: 'input', type: 'input',
@ -425,23 +425,29 @@ gulp.task('publish', ['src'], function(done){
var packageTemplate = _.template(fs.readFileSync('scripts/npm/package.json')); var packageTemplate = _.template(fs.readFileSync('scripts/npm/package.json'));
fs.writeFileSync(distDir + '/package.json', packageTemplate(answers)); fs.writeFileSync(distDir + '/package.json', packageTemplate(answers));
var spawn = require('child_process').spawn; done();
var npmCmd = spawn('npm', ['publish', './' + distDir]);
npmCmd.stdout.on('data', function (data) {
console.log(data);
});
npmCmd.stderr.on('data', function (data) {
console.log('npm err: ' + data);
});
npmCmd.on('close', function() {
done();
});
}); });
}); });
gulp.task('publish', ['package'], function(done){
var spawn = require('child_process').spawn;
var npmCmd = spawn('npm', ['publish', './dist']);
npmCmd.stdout.on('data', function (data) {
console.log(data.toString());
});
npmCmd.stderr.on('data', function (data) {
console.log('npm err: ' + data.toString());
});
npmCmd.on('close', function() {
done();
});
});
require('./scripts/docs/gulp-tasks')(gulp, flags) require('./scripts/docs/gulp-tasks')(gulp, flags)
//////////////////////////////////////////////////// ////////////////////////////////////////////////////

View File

@ -47,6 +47,8 @@ export class SearchbarInput {
* @property {string} [placeholder=Search] - Sets input placeholder to the value passed in * @property {string} [placeholder=Search] - Sets input placeholder to the value passed in
* *
* @property {Any} [input] - Expression to evaluate when the Searchbar input has changed * @property {Any} [input] - Expression to evaluate when the Searchbar input has changed
* @property {Any} [blur] - Expression to evaluate when the Searchbar input has blurred
* @property {Any} [focus] - Expression to evaluate when the Searchbar input has focused
* @property {Any} [cancel] - Expression to evaluate when the cancel button is clicked. * @property {Any} [cancel] - Expression to evaluate when the cancel button is clicked.
* @property {Any} [clear] - Expression to evaluate when the clear input button is clicked. * @property {Any} [clear] - Expression to evaluate when the clear input button is clicked.
* *
@ -75,6 +77,8 @@ export class Searchbar extends Ion {
@Input() ngModel: any; @Input() ngModel: any;
@Output() input: EventEmitter<Searchbar> = new EventEmitter(); @Output() input: EventEmitter<Searchbar> = new EventEmitter();
@Output() blur: EventEmitter<Searchbar> = new EventEmitter();
@Output() focus: EventEmitter<Searchbar> = new EventEmitter();
@Output() cancel: EventEmitter<Searchbar> = new EventEmitter(); @Output() cancel: EventEmitter<Searchbar> = new EventEmitter();
@Output() clear: EventEmitter<Searchbar> = new EventEmitter(); @Output() clear: EventEmitter<Searchbar> = new EventEmitter();
@ -147,6 +151,8 @@ export class Searchbar extends Ion {
* Sets the Searchbar to focused and aligned left on input focus. * Sets the Searchbar to focused and aligned left on input focus.
*/ */
inputFocused() { inputFocused() {
this.focus.emit(this);
this.isFocused = true; this.isFocused = true;
this.shouldLeftAlign = true; this.shouldLeftAlign = true;
} }
@ -164,6 +170,8 @@ export class Searchbar extends Ion {
this.blurInput = true; this.blurInput = true;
return; return;
} }
this.blur.emit(this);
this.isFocused = false; this.isFocused = false;
this.shouldLeftAlign = this.value && this.value.trim() != ''; this.shouldLeftAlign = this.value && this.value.trim() != '';
} }

View File

@ -27,4 +27,12 @@ class E2EApp {
triggerInput(searchbar) { triggerInput(searchbar) {
console.log("Triggered input", searchbar); console.log("Triggered input", searchbar);
} }
inputBlurred(searchbar) {
console.log("Blurred input", searchbar);
}
inputFocused(searchbar) {
console.log("Focused input", searchbar);
}
} }

View File

@ -1,6 +1,6 @@
<ion-content> <ion-content>
<h5 padding-left> Search - Default </h5> <h5 padding-left> Search - Default </h5>
<ion-searchbar [(ngModel)]="defaultSearch" (input)="triggerInput($event)" (cancel)="onCancelSearchbar($event)" (clear)="onClearSearchbar($event)" class="e2eDefaultFloatingSearchbar"></ion-searchbar> <ion-searchbar [(ngModel)]="defaultSearch" (input)="triggerInput($event)" (blur)="inputBlurred($event)" (focus)="inputFocused($event)" (cancel)="onCancelSearchbar($event)" (clear)="onClearSearchbar($event)" class="e2eDefaultFloatingSearchbar"></ion-searchbar>
<p padding-left> <p padding-left>
defaultSearch: <b>{{ defaultSearch }}</b> defaultSearch: <b>{{ defaultSearch }}</b>