fix watch for dev mode in gulpfile

This commit is contained in:
Keegan
2016-02-14 02:30:31 -08:00
parent 392c3af542
commit f00b288a82
3 changed files with 17 additions and 10 deletions
+14 -7
View File
@@ -5,13 +5,20 @@ module.exports = function() {
/** @type {ClayConfig} */ /** @type {ClayConfig} */
var Clay = window.Clay = this; var Clay = window.Clay = this;
/**
* @returns {void}
*/
function toggleBackground() {
if (this.get()) {
Clay.getItemByAppKey('background').enable();
} else {
Clay.getItemByAppKey('background').disable();
}
}
Clay.on(Clay.EVENTS.AFTER_BUILD, function() { Clay.on(Clay.EVENTS.AFTER_BUILD, function() {
Clay.getItemByAppKey('cool_stuff').on('change', function() { var coolStuffToggle = Clay.getItemByAppKey('cool_stuff');
if (this.get()) { toggleBackground.call(coolStuffToggle);
Clay.getItemByAppKey('background').enable(); coolStuffToggle.on('change', toggleBackground);
} else {
Clay.getItemByAppKey('background').disable();
}
});
}); });
}; };
+1 -1
View File
@@ -104,5 +104,5 @@ gulp.task('default', ['clay']);
gulp.task('dev', ['dev-js'], function() { gulp.task('dev', ['dev-js'], function() {
gulp.watch('src/styles/**/*.scss', ['sass']); gulp.watch('src/styles/**/*.scss', ['sass']);
gulp.watch(['src/scripts/**/*.js', 'src/templates/**/*.tpl'], ['js']); gulp.watch(['src/scripts/**/*.js', 'src/templates/**/*.tpl'], ['js']);
gulp.watch(['src/scripts/**/*.js', 'dev/**/*.js'], ['dev-js']); gulp.watch(['src/**', 'dev/**/*.js'], ['dev-js']);
}); });
+2 -2
View File
@@ -1,5 +1,5 @@
<div class="component-color"> <div class="component component-color">
<label class="component"> <label>
<input <input
data-manipulator-target data-manipulator-target
type="hidden" type="hidden"