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.

stephan 2020-12-26 22:09 trunk
Commit b75ce86581982b921219bce6f49bbb8aa192e96f3495d03a747feb882d4f8a07
1 file changed +8 -6
+8 -6
--- src/chat.js
+++ src/chat.js
@@ -138,11 +138,11 @@
138138
*/
139139
D.addClass(self.e.inputWrapper,'unsticky');
140140
}
141141
if(mip.nextSibling) mip.parentNode.insertBefore(e, mip.nextSibling);
142142
else mip.parentNode.appendChild(e);
143
- if(this.isUiFlipped()){
143
+ if(false && this.isUiFlipped()){
144144
//e.scrollIntoView();
145145
setTimeout(function(){
146146
//self.e.inputWrapper.scrollIntoView();
147147
//self.e.fileSelectWrapper.scrollIntoView();
148148
//e.scrollIntoView();
@@ -179,15 +179,17 @@
179179
D.addClass(document.body, 'chat-only-mode');
180180
document.body.scroll(0,document.body.height);
181181
}else{
182182
D.removeClass(f.elemsToToggle, 'hidden');
183183
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
+ }
189191
}
190192
const msg = document.querySelector('.message-widget');
191193
if(msg) setTimeout(()=>msg.scrollIntoView(),0);
192194
return this;
193195
},
194196
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button