Fossil SCM
/chat: slight size tweak to try to avoid message truncation in zoom mode. When switching views, ensure that any zoomed widget is moved back where it needs to be so that, e.g. visiting the config view while zooming does not cause the message to locally disappear.
Commit
5d71561e2052e7a5023801b348f323c42793cd2ac45b0d17f7cac25275dd9c87
Parent
4db8190360f9828…
2 files changed
+6
-2
+1
-1
+6
-2
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -593,10 +593,14 @@ | ||
| 593 | 593 | all other elements in that list. Returns e. |
| 594 | 594 | */ |
| 595 | 595 | setCurrentView: function(e){ |
| 596 | 596 | if(e===this.e.currentView){ |
| 597 | 597 | return e; |
| 598 | + } | |
| 599 | + if( e!==this.e.viewZoom && this.e.zoomedMsg ){ | |
| 600 | + this.zoomMessage(null, e); | |
| 601 | + return this.e.currentView; | |
| 598 | 602 | } |
| 599 | 603 | this.e.views.forEach(function(E){ |
| 600 | 604 | if(e!==E) D.addClass(E,'hidden'); |
| 601 | 605 | }); |
| 602 | 606 | this.e.currentView = e; |
| @@ -607,18 +611,18 @@ | ||
| 607 | 611 | }, |
| 608 | 612 | |
| 609 | 613 | /** |
| 610 | 614 | Makes message element eMsg the content of this.e.viewZoom. |
| 611 | 615 | */ |
| 612 | - zoomMessage: function(eMsg){ | |
| 616 | + zoomMessage: function(eMsg,nextView){ | |
| 613 | 617 | const marker = this.e.zoomMarker; |
| 614 | 618 | if( !eMsg || eMsg===this.e.zoomedMsg ){ |
| 615 | 619 | if( this.e.zoomedMsg ){ |
| 616 | 620 | marker.parentNode.insertBefore(this.e.zoomedMsg, marker); |
| 617 | 621 | delete this.e.zoomedMsg; |
| 618 | 622 | } |
| 619 | - this.setCurrentView(this.e.viewMessages); | |
| 623 | + this.setCurrentView(nextView || this.e.viewMessages); | |
| 620 | 624 | return; |
| 621 | 625 | } |
| 622 | 626 | console.log("zoom message",eMsg); |
| 623 | 627 | if( this.e.zoomedMsg ){ |
| 624 | 628 | marker.parentNode.insertBefore(this.e.zoomedMsg, marker); |
| 625 | 629 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -593,10 +593,14 @@ | |
| 593 | all other elements in that list. Returns e. |
| 594 | */ |
| 595 | setCurrentView: function(e){ |
| 596 | if(e===this.e.currentView){ |
| 597 | return e; |
| 598 | } |
| 599 | this.e.views.forEach(function(E){ |
| 600 | if(e!==E) D.addClass(E,'hidden'); |
| 601 | }); |
| 602 | this.e.currentView = e; |
| @@ -607,18 +611,18 @@ | |
| 607 | }, |
| 608 | |
| 609 | /** |
| 610 | Makes message element eMsg the content of this.e.viewZoom. |
| 611 | */ |
| 612 | zoomMessage: function(eMsg){ |
| 613 | const marker = this.e.zoomMarker; |
| 614 | if( !eMsg || eMsg===this.e.zoomedMsg ){ |
| 615 | if( this.e.zoomedMsg ){ |
| 616 | marker.parentNode.insertBefore(this.e.zoomedMsg, marker); |
| 617 | delete this.e.zoomedMsg; |
| 618 | } |
| 619 | this.setCurrentView(this.e.viewMessages); |
| 620 | return; |
| 621 | } |
| 622 | console.log("zoom message",eMsg); |
| 623 | if( this.e.zoomedMsg ){ |
| 624 | marker.parentNode.insertBefore(this.e.zoomedMsg, marker); |
| 625 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -593,10 +593,14 @@ | |
| 593 | all other elements in that list. Returns e. |
| 594 | */ |
| 595 | setCurrentView: function(e){ |
| 596 | if(e===this.e.currentView){ |
| 597 | return e; |
| 598 | } |
| 599 | if( e!==this.e.viewZoom && this.e.zoomedMsg ){ |
| 600 | this.zoomMessage(null, e); |
| 601 | return this.e.currentView; |
| 602 | } |
| 603 | this.e.views.forEach(function(E){ |
| 604 | if(e!==E) D.addClass(E,'hidden'); |
| 605 | }); |
| 606 | this.e.currentView = e; |
| @@ -607,18 +611,18 @@ | |
| 611 | }, |
| 612 | |
| 613 | /** |
| 614 | Makes message element eMsg the content of this.e.viewZoom. |
| 615 | */ |
| 616 | zoomMessage: function(eMsg,nextView){ |
| 617 | const marker = this.e.zoomMarker; |
| 618 | if( !eMsg || eMsg===this.e.zoomedMsg ){ |
| 619 | if( this.e.zoomedMsg ){ |
| 620 | marker.parentNode.insertBefore(this.e.zoomedMsg, marker); |
| 621 | delete this.e.zoomedMsg; |
| 622 | } |
| 623 | this.setCurrentView(nextView || this.e.viewMessages); |
| 624 | return; |
| 625 | } |
| 626 | console.log("zoom message",eMsg); |
| 627 | if( this.e.zoomedMsg ){ |
| 628 | marker.parentNode.insertBefore(this.e.zoomedMsg, marker); |
| 629 |
+1
-1
| --- src/style.chat.css | ||
| +++ src/style.chat.css | ||
| @@ -484,11 +484,11 @@ | ||
| 484 | 484 | } |
| 485 | 485 | body.chat #chat-zoom-content > .message-widget { |
| 486 | 486 | flex-grow: 1; |
| 487 | 487 | } |
| 488 | 488 | body.chat #chat-zoom-content > .message-widget > .message-widget-content { |
| 489 | - width: 100%; | |
| 489 | + width: 99%; | |
| 490 | 490 | } |
| 491 | 491 | body.chat #chat-zoom-content > .message-widget .toolbar.hide-in-zoom { |
| 492 | 492 | /* The various Delete buttons misinteract with zoom mode's moving-around |
| 493 | 493 | of message widgets, so hide them in zoom mode. */ |
| 494 | 494 | position: absolute !important; |
| 495 | 495 |
| --- src/style.chat.css | |
| +++ src/style.chat.css | |
| @@ -484,11 +484,11 @@ | |
| 484 | } |
| 485 | body.chat #chat-zoom-content > .message-widget { |
| 486 | flex-grow: 1; |
| 487 | } |
| 488 | body.chat #chat-zoom-content > .message-widget > .message-widget-content { |
| 489 | width: 100%; |
| 490 | } |
| 491 | body.chat #chat-zoom-content > .message-widget .toolbar.hide-in-zoom { |
| 492 | /* The various Delete buttons misinteract with zoom mode's moving-around |
| 493 | of message widgets, so hide them in zoom mode. */ |
| 494 | position: absolute !important; |
| 495 |
| --- src/style.chat.css | |
| +++ src/style.chat.css | |
| @@ -484,11 +484,11 @@ | |
| 484 | } |
| 485 | body.chat #chat-zoom-content > .message-widget { |
| 486 | flex-grow: 1; |
| 487 | } |
| 488 | body.chat #chat-zoom-content > .message-widget > .message-widget-content { |
| 489 | width: 99%; |
| 490 | } |
| 491 | body.chat #chat-zoom-content > .message-widget .toolbar.hide-in-zoom { |
| 492 | /* The various Delete buttons misinteract with zoom mode's moving-around |
| 493 | of message widgets, so hide them in zoom mode. */ |
| 494 | position: absolute !important; |
| 495 |