Commit c698f7e90e4b27c11b6514c6e8319e8d6d81059b
1 parent
ec7ce559
Exists in
staging
and in
4 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,13 +75,6 @@ jQuery(document).ready(function($) { | ||
75 | container.find('.display-comment-form').show(); | 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,6 +165,12 @@ jQuery(document).ready(function($) { | ||
172 | } | 165 | } |
173 | rootElement.focus(); | 166 | rootElement.focus(); |
174 | cssApplier.toggleSelection(); | 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 | function processAnchor(){ | 176 | function processAnchor(){ |