]> git.0d.be Git - panikdb.git/commitdiff
wiki: only open file dialog on empty figures
authorFrédéric Péters <fpeters@0d.be>
Thu, 11 Jun 2020 19:03:43 +0000 (21:03 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 11 Jun 2020 19:03:43 +0000 (21:03 +0200)
panikdb/static/css/style.scss
panikdb/static/js/combo.wiki.js

index 9519ce8db616a8ee82faa74c7c0768d4bed0b52e..32aa48dee66ed47ab4418b455ca9580c8fff0741 100644 (file)
@@ -759,13 +759,16 @@ div.wiki-section {
                cursor: pointer;
        }
        div.figure {
-               background: #eee;
                min-height: 50px;
                text-align: center;
                img {
                        max-width: 90%;
                }
                span.empty::before {
+                       margin: 0 auto;
+                       display: block;
+                       width: 90%;
+                       background: #eee;
                        padding: 1rem;
                        font-size: 200px;
                        content: "\f03e";
index 12efb063b7515d64a0208d392d36660f42ed1677..c8dfd32f6c885c4772525090012dc916bc18e02c 100644 (file)
@@ -76,8 +76,8 @@ function auto_anchors() {
       $image_upload.on('change', upload_image);
       $image_upload.appendTo(document.body);
 
-      $(document).on('click', 'div.figure', function() {
-        window.active_figure = this;
+      $(document).on('click', 'div.figure span.empty', function() {
+        window.active_figure = this.parentNode;
         $('#image-upload').trigger('click');
         return true;
       });