mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-27 20:36:33 -04:00
fix watch for dev mode in gulpfile
This commit is contained in:
+14
-7
@@ -5,13 +5,20 @@ module.exports = function() {
|
||||
/** @type {ClayConfig} */
|
||||
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.getItemByAppKey('cool_stuff').on('change', function() {
|
||||
if (this.get()) {
|
||||
Clay.getItemByAppKey('background').enable();
|
||||
} else {
|
||||
Clay.getItemByAppKey('background').disable();
|
||||
}
|
||||
});
|
||||
var coolStuffToggle = Clay.getItemByAppKey('cool_stuff');
|
||||
toggleBackground.call(coolStuffToggle);
|
||||
coolStuffToggle.on('change', toggleBackground);
|
||||
});
|
||||
};
|
||||
|
||||
+1
-1
@@ -104,5 +104,5 @@ gulp.task('default', ['clay']);
|
||||
gulp.task('dev', ['dev-js'], function() {
|
||||
gulp.watch('src/styles/**/*.scss', ['sass']);
|
||||
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']);
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="component-color">
|
||||
<label class="component">
|
||||
<div class="component component-color">
|
||||
<label>
|
||||
<input
|
||||
data-manipulator-target
|
||||
type="hidden"
|
||||
|
||||
Reference in New Issue
Block a user