community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1864233 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/unified.js wizard.js
Date Fri, 02 Aug 2019 14:41:22 GMT
Author: humbedooh
Date: Fri Aug  2 14:41:22 2019
New Revision: 1864233

URL: http://svn.apache.org/viewvc?rev=1864233&view=rev
Log:
tweaks for fixing focus bugs

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js?rev=1864233&r1=1864232&r2=1864233&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js Fri Aug  2 14:41:22
2019
@@ -12,8 +12,9 @@ function UnifiedEditor_highlight_section
     hilites.push({highlight: PLACEHOLDER, className: 'none' });
     
     // Capture text cursor position(s) before we continue.
-    let x = $('#unified-report').selectionStart;
-    let y = $('#unified-report').selectionEnd;
+    let x = $('#unified-report').prop('selectionStart');
+    let y = $('#unified-report').prop('selectionEnd');
+    let sx = this.object.scrollX, sy = this.object.scrollY;
     
     // If additional text is marked for highlighting, we'll have to
     // first destroy any original highlighting, as it's params changed!
@@ -34,9 +35,11 @@ function UnifiedEditor_highlight_section
     
     // If x == y (cursor is present and not marking characters),
     // We'll force focus on ourselves as highlighting loses it.
-    if (x == y) {
-        $(this.object).selectionStart = x;
-        $(this.object).selectionEnd = y;
+    if (x == y || true) {
+        $(this.object).prop( {
+            'selectionStart': x,
+            'selectionEnd': y}
+            );
         $(this.object).focus();
     }
 }

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1864233&r1=1864232&r2=1864233&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Fri Aug  2 14:41:22 2019
@@ -1862,8 +1862,9 @@ function UnifiedEditor_highlight_section
     hilites.push({highlight: PLACEHOLDER, className: 'none' });
     
     // Capture text cursor position(s) before we continue.
-    let x = $('#unified-report').selectionStart;
-    let y = $('#unified-report').selectionEnd;
+    let x = $('#unified-report').prop('selectionStart');
+    let y = $('#unified-report').prop('selectionEnd');
+    let sx = this.object.scrollX, sy = this.object.scrollY;
     
     // If additional text is marked for highlighting, we'll have to
     // first destroy any original highlighting, as it's params changed!
@@ -1884,9 +1885,11 @@ function UnifiedEditor_highlight_section
     
     // If x == y (cursor is present and not marking characters),
     // We'll force focus on ourselves as highlighting loses it.
-    if (x == y) {
-        $(this.object).selectionStart = x;
-        $(this.object).selectionEnd = y;
+    if (x == y || true) {
+        $(this.object).prop( {
+            'selectionStart': x,
+            'selectionEnd': y}
+            );
         $(this.object).focus();
     }
 }



Mime
View raw message