mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-28 12:56:34 -04:00
27 lines
585 B
JavaScript
27 lines
585 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);
|
|
});
|
|
|
|
console.log('userData: ', Clay.meta.userData);
|
|
};
|