Coming from a Meteor background, I'd use JQuery to show/hide a div, with paper-checkbox like so:
HTML:
<paper-checkbox name="remoteLocation" id="remote-chk" checked>Remote Location</paper-checkbox>
<div id="autoUpdate" class="autoUpdate" style="display: none;">content</div>
Script:
Template.<templateName>.events({
'change #remote-chk' : function(e){
if (e.target.checked) {
$('#autoUpdate').fadeOut('slow');
} else {
$('#autoUpdate').fadeIn('slow');
}
}
)};
Now, in Polymer 1.0, I am trying to implement the same thing:
<link rel="import" href="/bower_components/paper-checkbox/paper-checkbox.html">
<dom-module id="my-app">
<template>
<paper-checkbox name="remoteLocation" id="remote-chk" on-click="showMe" checked>Remote Location</paper-checkbox>
<div id="autoUpdate" class="autoUpdate" style="display: none;">content</div>
</template>
<script>
Polymer({
is: "my-app",
showMe: function () {
if (e.target.checked) {
$('#autoUpdate').fadeOut('slow');
} else {
$('#autoUpdate').fadeIn('slow');
}
}
});
</script>
</dom-module>
Could someone spare a second eye, please, as nothing works? Thanks.