Commit cbb08befb84cc780fa8792142121d583a579f53e

Authored by Victor Costa
1 parent 53936dbb
Exists in master

comment_paragraph: fix range selection

Showing 1 changed file with 6 additions and 7 deletions   Show diff stats
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(){