mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-28 04:46:57 -04:00
25 lines
535 B
JavaScript
25 lines
535 B
JavaScript
'use strict';
|
|
|
|
module.exports = function() {
|
|
|
|
/** @type {ClayConfig} */
|
|
var Clay = window.Clay = this;
|
|
|
|
/**
|
|
* @returns {void}
|
|
*/
|
|
function toggleBackground() {
|
|
if (this.get()) {
|
|
Clay.getItemByAppKey('colorTest').enable();
|
|
} else {
|
|
Clay.getItemByAppKey('colorTest').disable();
|
|
}
|
|
}
|
|
|
|
Clay.on(Clay.EVENTS.AFTER_BUILD, function() {
|
|
var coolStuffToggle = Clay.getItemByAppKey('cool_stuff');
|
|
toggleBackground.call(coolStuffToggle);
|
|
coolStuffToggle.on('change', toggleBackground);
|
|
});
|
|
};
|