Fossil SCM
Disabled automatic scrolling when a new chat message arrives, as it is unnecessary when the user input fields are not sticky. To revisit later with sticky input fields.
Commit
b75ce86581982b921219bce6f49bbb8aa192e96f3495d03a747feb882d4f8a07
Parent
12b5391926f7aaf…
1 file changed
+8
-6
+8
-6
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -138,11 +138,11 @@ | ||
| 138 | 138 | */ |
| 139 | 139 | D.addClass(self.e.inputWrapper,'unsticky'); |
| 140 | 140 | } |
| 141 | 141 | if(mip.nextSibling) mip.parentNode.insertBefore(e, mip.nextSibling); |
| 142 | 142 | else mip.parentNode.appendChild(e); |
| 143 | - if(this.isUiFlipped()){ | |
| 143 | + if(false && this.isUiFlipped()){ | |
| 144 | 144 | //e.scrollIntoView(); |
| 145 | 145 | setTimeout(function(){ |
| 146 | 146 | //self.e.inputWrapper.scrollIntoView(); |
| 147 | 147 | //self.e.fileSelectWrapper.scrollIntoView(); |
| 148 | 148 | //e.scrollIntoView(); |
| @@ -179,15 +179,17 @@ | ||
| 179 | 179 | D.addClass(document.body, 'chat-only-mode'); |
| 180 | 180 | document.body.scroll(0,document.body.height); |
| 181 | 181 | }else{ |
| 182 | 182 | D.removeClass(f.elemsToToggle, 'hidden'); |
| 183 | 183 | D.removeClass(document.body, 'chat-only-mode'); |
| 184 | - setTimeout(()=>document.body.scrollIntoView( | |
| 185 | - /*moves to (0,0), whereas scrollTo(0,0) does not! | |
| 186 | - setTimeout() is unfortunately necessary to get the scroll | |
| 187 | - placement correct.*/ | |
| 188 | - ), 0); | |
| 184 | + if(false){ | |
| 185 | + setTimeout(()=>document.body.scrollIntoView( | |
| 186 | + /*moves to (0,0), whereas scrollTo(0,0) does not! | |
| 187 | + setTimeout() is unfortunately necessary to get the scroll | |
| 188 | + placement correct.*/ | |
| 189 | + ), 0); | |
| 190 | + } | |
| 189 | 191 | } |
| 190 | 192 | const msg = document.querySelector('.message-widget'); |
| 191 | 193 | if(msg) setTimeout(()=>msg.scrollIntoView(),0); |
| 192 | 194 | return this; |
| 193 | 195 | }, |
| 194 | 196 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -138,11 +138,11 @@ | |
| 138 | */ |
| 139 | D.addClass(self.e.inputWrapper,'unsticky'); |
| 140 | } |
| 141 | if(mip.nextSibling) mip.parentNode.insertBefore(e, mip.nextSibling); |
| 142 | else mip.parentNode.appendChild(e); |
| 143 | if(this.isUiFlipped()){ |
| 144 | //e.scrollIntoView(); |
| 145 | setTimeout(function(){ |
| 146 | //self.e.inputWrapper.scrollIntoView(); |
| 147 | //self.e.fileSelectWrapper.scrollIntoView(); |
| 148 | //e.scrollIntoView(); |
| @@ -179,15 +179,17 @@ | |
| 179 | D.addClass(document.body, 'chat-only-mode'); |
| 180 | document.body.scroll(0,document.body.height); |
| 181 | }else{ |
| 182 | D.removeClass(f.elemsToToggle, 'hidden'); |
| 183 | D.removeClass(document.body, 'chat-only-mode'); |
| 184 | setTimeout(()=>document.body.scrollIntoView( |
| 185 | /*moves to (0,0), whereas scrollTo(0,0) does not! |
| 186 | setTimeout() is unfortunately necessary to get the scroll |
| 187 | placement correct.*/ |
| 188 | ), 0); |
| 189 | } |
| 190 | const msg = document.querySelector('.message-widget'); |
| 191 | if(msg) setTimeout(()=>msg.scrollIntoView(),0); |
| 192 | return this; |
| 193 | }, |
| 194 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -138,11 +138,11 @@ | |
| 138 | */ |
| 139 | D.addClass(self.e.inputWrapper,'unsticky'); |
| 140 | } |
| 141 | if(mip.nextSibling) mip.parentNode.insertBefore(e, mip.nextSibling); |
| 142 | else mip.parentNode.appendChild(e); |
| 143 | if(false && this.isUiFlipped()){ |
| 144 | //e.scrollIntoView(); |
| 145 | setTimeout(function(){ |
| 146 | //self.e.inputWrapper.scrollIntoView(); |
| 147 | //self.e.fileSelectWrapper.scrollIntoView(); |
| 148 | //e.scrollIntoView(); |
| @@ -179,15 +179,17 @@ | |
| 179 | D.addClass(document.body, 'chat-only-mode'); |
| 180 | document.body.scroll(0,document.body.height); |
| 181 | }else{ |
| 182 | D.removeClass(f.elemsToToggle, 'hidden'); |
| 183 | D.removeClass(document.body, 'chat-only-mode'); |
| 184 | if(false){ |
| 185 | setTimeout(()=>document.body.scrollIntoView( |
| 186 | /*moves to (0,0), whereas scrollTo(0,0) does not! |
| 187 | setTimeout() is unfortunately necessary to get the scroll |
| 188 | placement correct.*/ |
| 189 | ), 0); |
| 190 | } |
| 191 | } |
| 192 | const msg = document.querySelector('.message-widget'); |
| 193 | if(msg) setTimeout(()=>msg.scrollIntoView(),0); |
| 194 | return this; |
| 195 | }, |
| 196 |