removed alert and added a less intrusive notification

This commit is contained in:
Gonçalo Valério 2019-04-13 21:07:34 +01:00
parent 9018c0e9ba
commit 00eb6f3902
2 changed files with 10 additions and 2 deletions

View File

@ -88,14 +88,19 @@ var callbackDetails = new Vue({
el: "#callback-details", el: "#callback-details",
delimiters: ["[[", "]]"], delimiters: ["[[", "]]"],
data: { data: {
callback_url: "" callback_url: "",
show_copy_notification: false
}, },
methods: { methods: {
copytoclipboard: function() { copytoclipboard: function() {
var url = document.getElementById("callback-uuid-field"); var url = document.getElementById("callback-uuid-field");
url.select(); url.select();
document.execCommand("copy"); document.execCommand("copy");
alert("The callback url was copied to your clipboard."); this.show_copy_notification = true;
let self = this;
setTimeout(function() {
self.show_copy_notification = false;
}, 2000);
} }
}, },
mounted: function() { mounted: function() {

View File

@ -47,6 +47,9 @@
</a> </a>
</div> </div>
</div> </div>
<div class="notification is-success" v-if="show_copy_notification">
The callback url was copied to your clipboard.
</div>
</div> </div>
</section> </section>
<section class="section" id="request-list"> <section class="section" id="request-list">