Bug 1529915 - Don't launch property dialog when double-clicking on text in list or table. r=mkmelin
authorBenjamin Flanagin <benjamin@thunderbird.net>
Fri, 31 May 2019 17:25:27 +0200
changeset 35885 e5d177f7e623430192c9fc87db123171e1d755fd
parent 35884 2beda7edf8e9c210c4259c021906a4be3b5bb152
child 35886 809b8d802ea7791542957699f82a88a7fc45c29d
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersmkmelin
bugs1529915
Bug 1529915 - Don't launch property dialog when double-clicking on text in list or table. r=mkmelin
editor/ui/composer/content/editor.js
--- a/editor/ui/composer/content/editor.js
+++ b/editor/ui/composer/content/editor.js
@@ -1521,18 +1521,20 @@ function GetObjectForProperties() {
     if (!node)
       node = anchorNode;
   } catch (e) {}
 
   while (node) {
     if (node.nodeName) {
       var nodeName = node.nodeName.toLowerCase();
 
-      // Done when we hit the body
-      if (nodeName == "body") break;
+      // Done when we hit the body or #text.
+      if (nodeName == "body" || nodeName == "#text") {
+        break;
+      }
 
       if ((nodeName == "a" && node.href) ||
           nodeName == "ol" || nodeName == "ul" || nodeName == "dl" ||
           nodeName == "td" || nodeName == "th" ||
           nodeName == "table" || nodeName == "math") {
         return node;
       }
     }