Browse Source

adding

master
Björn 4 years ago
parent
commit
dbed9a5e49
2 changed files with 46 additions and 1 deletions
  1. +1
    -1
      package.json
  2. +45
    -0
      src/TinyConsentLink.riot

+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{
"name": "tiny-consent",
"version": "1.1.1",
"version": "1.1.2",
"description": "Consent Banner for GDPR with RiotJS, part of Tiny-Components",
"scripts": {
"dev": "npm run development",


+ 45
- 0
src/TinyConsentLink.riot View File

@ -0,0 +1,45 @@
<tiny-consent-link>
<a id="tiny-consent-link" class="tiny-consent-link" onclick={ handleOpen }>
{ state.options.text.open }
</a>
<script>
/**
* tiny-consent-link.riot
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitlab.tentakelfabrik.de/tentakelfabrik/tiny-components/tiny-consent Gitlab Repository
*
*/
export default {
/**
*
*
*/
state:
{
options: {
text: {
'open': 'Open'
}
}
},
/**
*
* @param {[type]} event
* @return {[type]}
*/
handleOpen(event) {
event.preventDefault();
window.dispatchEvent(new window.CustomEvent('tiny-consent-open'))
}
}
</script>
</tiny-consent-link>

Loading…
Cancel
Save