Visual editor: fix for browser compatibility
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 19 Apr 2013 10:14:25 +0000 (12:14 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 19 Apr 2013 10:14:25 +0000 (12:14 +0200)
isSameNode doesn't exist in FF

modules/visualEditor.js

index 70fc435..9cec971 100644 (file)
@@ -131,7 +131,7 @@ rng.modules.visualEditor = function(sandbox) {
             view.node.on('change', '.rng-visualEditor-editPaneSelectionForm select', function(e) {\r
                 var target = $(e.target);\r
                 var selection = window.getSelection();\r
             view.node.on('change', '.rng-visualEditor-editPaneSelectionForm select', function(e) {\r
                 var target = $(e.target);\r
                 var selection = window.getSelection();\r
-                if(selection.anchorNode.isSameNode(selection.focusNode) && selection.anchorNode.nodeType === Node.TEXT_NODE) {                   \r
+                if(selection.anchorNode === selection.focusNode && selection.anchorNode.nodeType === Node.TEXT_NODE) {\r
                     var startOffset = selection.anchorOffset;\r
                     var endOffset = selection.focusOffset;\r
                     if(startOffset > endOffset) {\r
                     var startOffset = selection.anchorOffset;\r
                     var endOffset = selection.focusOffset;\r
                     if(startOffset > endOffset) {\r