From 9229df7bee5674b5c2aab92266de7cdee13b6658 Mon Sep 17 00:00:00 2001 From: G14 Date: Sun, 18 Sep 2016 20:07:35 +0500 Subject: [PATCH] fix copy to clipboard on callback --- src/waitlist.html | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/waitlist.html b/src/waitlist.html index c851e3d..4e3838b 100644 --- a/src/waitlist.html +++ b/src/waitlist.html @@ -101,26 +101,29 @@ afterSuccess: function(data, form) { - jQuery("#maitre-share-plain-url").on('click', function () { - var link = document.createRange(); - link.selectNode(this); - document.getSelection().addRange(link); - var copied = document.execCommand('copy'); - var text = this.innerHTML; - if(copied) { - var copytext = 'Copied to clipboard'; - jQuery("#maitre-share-plain-url").html(copytext); - setTimeout(function(){ - jQuery("#maitre-share-plain-url").html(text); - },1000) - } - }) if (data.response == "subscriber_created") { + jQuery(".status-text").removeClass('shown'); jQuery("#maitre-verification").html( "Remember to confirm your email to be added to the signup queue.
Improve your position by referring your friends and spreading the word."); jQuery("#maitre-people-behind-number").html("0"); jQuery(".gradient-text").empty(); + + jQuery("#maitre-share-plain-url").on('click', function () { + var link = document.createRange(); + link.selectNode(this); + document.getSelection().addRange(link); + var copied = document.execCommand('copy'); + var text = this.innerHTML; + if(copied) { + var copytext = 'Copied to clipboard'; + jQuery("#maitre-share-plain-url").html(copytext); + setTimeout(function(){ + jQuery("#maitre-share-plain-url").html(text); + },1000) + } + }); + ga('send', 'event', 'Waitlist', 'Sign Up', 'Waitlist'); } },