Fossil SCM
/chat: removed some debug output. Reformulated part of the previous checkin to only re-grab input focus if the input field is not document.activeElement.
Commit
85a99733d543b965dd0bdeb0ae74d418e5c4c732e8e5eea2e8ecbf80a0b94c74
Parent
503395796e5f977…
1 file changed
+4
-3
+4
-3
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -780,19 +780,20 @@ | ||
| 780 | 780 | }; |
| 781 | 781 | document.addEventListener('visibilitychange', function(ev){ |
| 782 | 782 | cs.pageIsActive = ('visible' === document.visibilityState); |
| 783 | 783 | if(cs.pageIsActive){ |
| 784 | 784 | cs.e.pageTitle.innerText = cs.pageTitleOrig; |
| 785 | - console.debug("Taking back input focus."); | |
| 786 | - cs.inputFocus( | |
| 785 | + if(document.activeElement!==cs.inputElement()){ | |
| 787 | 786 | /* An attempt to resolve usability problem reported by Joe |
| 788 | 787 | M. where the Pale Moon browser is giving input focus to |
| 789 | 788 | the Preview button. The down-side of this is that it will |
| 790 | 789 | deselect any text which was previously selected on this |
| 791 | 790 | page. This also, unfortunately, places the focus at the |
| 792 | 791 | start of the element, rather than the last cursor position |
| 793 | - (like a textarea would). */); | |
| 792 | + (like a textarea would). */ | |
| 793 | + cs.inputFocus(); | |
| 794 | + } | |
| 794 | 795 | } |
| 795 | 796 | }, true); |
| 796 | 797 | cs.setCurrentView(cs.e.viewMessages); |
| 797 | 798 | |
| 798 | 799 | cs.e.activeUserList.addEventListener('click', function f(ev){ |
| 799 | 800 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -780,19 +780,20 @@ | |
| 780 | }; |
| 781 | document.addEventListener('visibilitychange', function(ev){ |
| 782 | cs.pageIsActive = ('visible' === document.visibilityState); |
| 783 | if(cs.pageIsActive){ |
| 784 | cs.e.pageTitle.innerText = cs.pageTitleOrig; |
| 785 | console.debug("Taking back input focus."); |
| 786 | cs.inputFocus( |
| 787 | /* An attempt to resolve usability problem reported by Joe |
| 788 | M. where the Pale Moon browser is giving input focus to |
| 789 | the Preview button. The down-side of this is that it will |
| 790 | deselect any text which was previously selected on this |
| 791 | page. This also, unfortunately, places the focus at the |
| 792 | start of the element, rather than the last cursor position |
| 793 | (like a textarea would). */); |
| 794 | } |
| 795 | }, true); |
| 796 | cs.setCurrentView(cs.e.viewMessages); |
| 797 | |
| 798 | cs.e.activeUserList.addEventListener('click', function f(ev){ |
| 799 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -780,19 +780,20 @@ | |
| 780 | }; |
| 781 | document.addEventListener('visibilitychange', function(ev){ |
| 782 | cs.pageIsActive = ('visible' === document.visibilityState); |
| 783 | if(cs.pageIsActive){ |
| 784 | cs.e.pageTitle.innerText = cs.pageTitleOrig; |
| 785 | if(document.activeElement!==cs.inputElement()){ |
| 786 | /* An attempt to resolve usability problem reported by Joe |
| 787 | M. where the Pale Moon browser is giving input focus to |
| 788 | the Preview button. The down-side of this is that it will |
| 789 | deselect any text which was previously selected on this |
| 790 | page. This also, unfortunately, places the focus at the |
| 791 | start of the element, rather than the last cursor position |
| 792 | (like a textarea would). */ |
| 793 | cs.inputFocus(); |
| 794 | } |
| 795 | } |
| 796 | }, true); |
| 797 | cs.setCurrentView(cs.e.viewMessages); |
| 798 | |
| 799 | cs.e.activeUserList.addEventListener('click', function f(ev){ |
| 800 |