Commit c698f7e90e4b27c11b6514c6e8319e8d6d81059b
1 parent
ec7ce559
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
comment_paragraph: fix range selection
Showing
1 changed file
with
6 additions
and
7 deletions
Show diff stats
plugins/comment_paragraph/public/comment_paragraph_macro.js
| ... | ... | @@ -75,13 +75,6 @@ jQuery(document).ready(function($) { |
| 75 | 75 | container.find('.display-comment-form').show(); |
| 76 | 76 | } |
| 77 | 77 | }); |
| 78 | - | |
| 79 | - //set a one time handler to prevent multiple selections | |
| 80 | - var fn = function() { | |
| 81 | - hideAllSelectedAreasExcept(); | |
| 82 | - $('.comment-paragraph-plugin').off('mousedown', '.comment_paragraph', fn); | |
| 83 | - } | |
| 84 | - $('.comment-paragraph-plugin').on('mousedown', '.comment_paragraph', fn); | |
| 85 | 78 | }); |
| 86 | 79 | |
| 87 | 80 | |
| ... | ... | @@ -172,6 +165,12 @@ jQuery(document).ready(function($) { |
| 172 | 165 | } |
| 173 | 166 | rootElement.focus(); |
| 174 | 167 | cssApplier.toggleSelection(); |
| 168 | + //set a one time handler to prevent multiple selections | |
| 169 | + var fn = function() { | |
| 170 | + hideAllSelectedAreasExcept(); | |
| 171 | + $('.comment-paragraph-plugin').off('mousedown', '.comment_paragraph', fn); | |
| 172 | + } | |
| 173 | + $('.comment-paragraph-plugin').on('mousedown', '.comment_paragraph', fn); | |
| 175 | 174 | }); |
| 176 | 175 | |
| 177 | 176 | function processAnchor(){ | ... | ... |