-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdemo.js
48 lines (42 loc) · 1.25 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Proceed only if the DOM is loaded and ready.
*
* @param {Function} fn The function to be executed when DOM is ready.
*/
function domReady(fn) {
document.addEventListener('DOMContentLoaded', fn);
// Is the DOM ready now? If so, execute the given function.
if (document.readyState === 'interactive' || document.readyState === 'complete') {
fn();
}
}
/**
* Run when DOM is ready.
*/
domReady(function() {
const Vue = require('../node_modules/vue/dist/vue.min.js');
// const MailtoUI = require('../src/js/mailtoui.js');
const MailtoUI = require('../dist/mailtoui-min.js');
var app = new Vue({
el: '#app',
data: {
emailSyntax: '{{ email }}',
email: '[email protected]',
emailDisplay: 'Mailto link with cc'
},
computed: {
mailtoHref: function() {
return 'mailto:' + this.email + '[email protected]';
}
},
mounted() {
MailtoUI.run({
buttonTextCopy: 'Copia',
buttonIconCopy: '/demo/bear.svg',
buttonTextCopyAction: 'Copiado!',
autoClose: false,
disableOnMobile: true
});
}
});
});