Fossil SCM

Removed an accidental extraneous animation on every chat message sent.

stephan 2021-09-24 17:11 chat-user-filter
Commit 0fe5b6cb7e2c44ca436dc390934ff5a5292dce2192febd900ac916bbe725b6ed
1 file changed +3
--- src/chat.js
+++ src/chat.js
@@ -444,10 +444,13 @@
444444
Expects e to be one of the elements in this.e.views.
445445
The 'hidden' class is removed from e and added to
446446
all other elements in that list. Returns e.
447447
*/
448448
setCurrentView: function(e){
449
+ if(e===this.e.currentView){
450
+ return e;
451
+ }
449452
this.e.views.forEach(function(E){
450453
if(e!==E) D.addClass(E,'hidden');
451454
});
452455
this.e.currentView = D.removeClass(e,'hidden');
453456
this.animate(this.e.currentView, 'anim-fade-in-fast');
454457
--- src/chat.js
+++ src/chat.js
@@ -444,10 +444,13 @@
444 Expects e to be one of the elements in this.e.views.
445 The 'hidden' class is removed from e and added to
446 all other elements in that list. Returns e.
447 */
448 setCurrentView: function(e){
 
 
 
449 this.e.views.forEach(function(E){
450 if(e!==E) D.addClass(E,'hidden');
451 });
452 this.e.currentView = D.removeClass(e,'hidden');
453 this.animate(this.e.currentView, 'anim-fade-in-fast');
454
--- src/chat.js
+++ src/chat.js
@@ -444,10 +444,13 @@
444 Expects e to be one of the elements in this.e.views.
445 The 'hidden' class is removed from e and added to
446 all other elements in that list. Returns e.
447 */
448 setCurrentView: function(e){
449 if(e===this.e.currentView){
450 return e;
451 }
452 this.e.views.forEach(function(E){
453 if(e!==E) D.addClass(E,'hidden');
454 });
455 this.e.currentView = D.removeClass(e,'hidden');
456 this.animate(this.e.currentView, 'anim-fade-in-fast');
457

Keyboard Shortcuts

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