Button on dashboard

There is a thread demonstrating mousedown and mouseup messages.

And my test of it lighting up an led while the button is clicked:

[{"id":"011e42e065ce8abe","type":"ui_template","z":"b5d64c1e024cd3e1","group":"5f36819feb573bce","name":"","order":1,"width":"0","height":"0","format":"<div class=\"momentary\">\n    <md-button> Momentary Button</md-button>\n</div>\n\n<script>\n    (function($scope) {\n    \n$('.momentary').on('touchstart mousedown', function(e) {\n    e.preventDefault(); //prevent default behavior\n    $scope.send({\"payload\": true});\n});\n\n$('.momentary').on('touchend mouseup', function(e) {\n    e.preventDefault(); //prevent default behavior\n    $scope.send({\"payload\": false});\n});\n    \n})(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":320,"y":140,"wires":[["feffe07cd1f9b458"]]},{"id":"7fda98f6f1f98db6","type":"inject","z":"b5d64c1e024cd3e1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":140,"wires":[["011e42e065ce8abe"]]},{"id":"feffe07cd1f9b458","type":"ui_led","z":"b5d64c1e024cd3e1","order":1,"group":"5f36819feb573bce","width":"1","height":"1","label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#ff0000","value":"true","valueType":"bool"},{"color":"#008000","value":"false","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":470,"y":140,"wires":[]},{"id":"5f36819feb573bce","type":"ui_group","name":"Delta","tab":"dbf999e51b777958","order":8,"disp":true,"width":"6","collapse":false,"className":""},{"id":"dbf999e51b777958","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]