You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ni...@apache.org on 2020/01/18 10:46:46 UTC

[cordova-docs] branch plugin-search updated (5cdf0d0 -> 9c4e583)

This is an automated email from the ASF dual-hosted git repository.

niklasmerz pushed a change to branch plugin-search
in repository https://gitbox.apache.org/repos/asf/cordova-docs.git.


 discard 5cdf0d0  Fix "Argument 1 of Range.selectNode is not an object"
    omit 2e2622f  Fix typerror in plugin search
     add 367455c  Fix typerror in plugin search (#1052)
     new 9c4e583  Fix "Argument 1 of Range.selectNode is not an object"

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5cdf0d0)
            \
             N -- N -- N   refs/heads/plugin-search (9c4e583)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[cordova-docs] 01/01: Fix "Argument 1 of Range.selectNode is not an object"

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

niklasmerz pushed a commit to branch plugin-search
in repository https://gitbox.apache.org/repos/asf/cordova-docs.git

commit 9c4e583a01de0b89c111ca09fbbc03a5e44f4fb7
Author: Niklas Merz <ni...@apache.org>
AuthorDate: Sat Jan 18 11:44:10 2020 +0100

    Fix "Argument 1 of Range.selectNode is not an object"
---
 www/static/plugins/plugin.jsx | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/www/static/plugins/plugin.jsx b/www/static/plugins/plugin.jsx
index b63dce5..3886a26 100755
--- a/www/static/plugins/plugin.jsx
+++ b/www/static/plugins/plugin.jsx
@@ -10,19 +10,22 @@ var Plugin = createClass({
     },
     copyText: function() {
         var range = document.createRange();
-        range.selectNode(this.getDOMNode().getElementsByClassName("cordova-add-command")[0]);
+        var elements = this.getDOMNode().getElementsByClassName("cordova-add-command");
+        if(elements.length > 0) {
+            range.selectNode(elements[0]);
 
-        var select = window.getSelection();
-        select.removeAllRanges();
-        select.addRange(range);
+            var select = window.getSelection();
+            select.removeAllRanges();
+            select.addRange(range);
 
-        try {
-            document.execCommand("copy");
-        } catch(e) {
-            // Silently fail for now
-        }
+            try {
+                document.execCommand("copy");
+            } catch(e) {
+                // Silently fail for now
+            }
 
-        select.removeAllRanges();
+            select.removeAllRanges();
+        }
     },
     render: function() {
         if(!this.props.plugin) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org