emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gruvbox-theme 1be12068a8 115/258: add click handler


From: ELPA Syncer
Subject: [nongnu] elpa/gruvbox-theme 1be12068a8 115/258: add click handler
Date: Sat, 1 Jan 2022 01:59:35 -0500 (EST)

branch: elpa/gruvbox-theme
commit 1be12068a8a116e27e87c23f53f4494923a77428
Author: jasonm23 <jasonm23@gmail.com>
Commit: jasonm23 <jasonm23@gmail.com>

    add click handler
---
 palette/js/main.js | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/palette/js/main.js b/palette/js/main.js
index 22f31a3587..2e2ec4b9a2 100644
--- a/palette/js/main.js
+++ b/palette/js/main.js
@@ -218,7 +218,7 @@ window.onload=function(){
 
 Vue.component('palette-group', {
   props: ['title', 'colors', 'prefix'],
-  template: `<div class="palette-group">
+  template: `<div class="palette-group" v-on:click="makeImg">
                <h3>{{title}}</h3>
                <swatch v-for="swatch in colors"
                        v-bind:prefix="prefix"
@@ -232,7 +232,17 @@ Vue.component('palette-group', {
                </swatch>
                <div class="group-separator"></div>
              </div>
-`
+`,
+  methods:{
+    makeImg: function(e){
+      html2canvas(e.target, {
+        onrendered: function(canvas) {
+          document.body.appendChild(canvas);
+        },
+        background: undefined
+      });
+    }
+  }
 });
 
 Vue.component('swatch', {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]