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} */
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);
});
};