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 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(){
... ...