From 66fa0c26ab74467645e2cc63a4f48ef82e3f5748 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 9 Jul 2019 13:22:50 +0200 Subject: Copy client info to clipboard From the listing page and the create summary page, you can now copy client info to the clipboard using dedicated buttons. --- app/Resources/static/themes/_global/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index 9ad96fc0..66ac063b 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -4,6 +4,8 @@ import $ from 'jquery'; /* Annotations */ import annotator from 'annotator'; +import ClipboardJS from 'clipboard'; + /* Fonts */ import 'material-design-icons-iconfont/dist/material-design-icons.css'; import 'lato-font/css/lato-font.css'; @@ -107,4 +109,12 @@ $(document).ready(() => { $('#user_emailTwoFactor').on('change', () => { $('#user_googleTwoFactor').prop('checked', false); }); + + // handle copy to clipboard for developer stuff + const clipboard = new ClipboardJS('.btn'); + clipboard.on('success', (e) => { + console.info(e.text); + + e.clearSelection(); + }); }); -- cgit v1.2.3