Fossil SCM
/chat: when applying a filter, automatically switch to the messages view. Apply hashtag processing to the preview view.
Commit
b59a761bb2b0143e4289795ecb6abf28e4c31af6dc8f039cb7cc25758b21d22f
Parent
93bf25055ab7864…
1 file changed
+2
-1
+2
-1
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -560,10 +560,11 @@ | ||
| 560 | 560 | e.classList.add('hidden'); |
| 561 | 561 | } |
| 562 | 562 | }); |
| 563 | 563 | D.removeClass(this.e.btnClearFilter, 'hidden'); |
| 564 | 564 | } |
| 565 | + this.setCurrentView(this.e.viewMessages); | |
| 565 | 566 | if(eLast) eLast.scrollIntoView(false); |
| 566 | 567 | else this.scrollMessagesTo(1); |
| 567 | 568 | return this; |
| 568 | 569 | }, |
| 569 | 570 | /** |
| @@ -896,11 +897,10 @@ | ||
| 896 | 897 | const setupHashtags = function f(elem){ |
| 897 | 898 | if(!f.$click){ |
| 898 | 899 | f.$click = function(ev){ |
| 899 | 900 | const tag = ev.target.dataset.hashtag; |
| 900 | 901 | if(tag){ |
| 901 | - console.debug("hashtag = ",tag); | |
| 902 | 902 | Chat.setHashtagFilter( |
| 903 | 903 | tag===Chat.filter.hashtag.activeTag |
| 904 | 904 | ? false : tag |
| 905 | 905 | ); |
| 906 | 906 | } |
| @@ -1514,10 +1514,11 @@ | ||
| 1514 | 1514 | const btnPreview = Chat.e.btnPreview; |
| 1515 | 1515 | Chat.setPreviewText = function(t){ |
| 1516 | 1516 | this.setCurrentView(this.e.viewPreview); |
| 1517 | 1517 | this.e.previewContent.innerHTML = t; |
| 1518 | 1518 | this.e.viewPreview.querySelectorAll('a').forEach(addAnchorTargetBlank); |
| 1519 | + setupHashtags(this.e.previewContent)/*arguable, for usability reasons*/; | |
| 1519 | 1520 | this.e.inputCurrent.focus(); |
| 1520 | 1521 | }; |
| 1521 | 1522 | Chat.e.viewPreview.querySelector('#chat-preview-close'). |
| 1522 | 1523 | addEventListener('click', ()=>Chat.setCurrentView(Chat.e.viewMessages), false); |
| 1523 | 1524 | let previewPending = false; |
| 1524 | 1525 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -560,10 +560,11 @@ | |
| 560 | e.classList.add('hidden'); |
| 561 | } |
| 562 | }); |
| 563 | D.removeClass(this.e.btnClearFilter, 'hidden'); |
| 564 | } |
| 565 | if(eLast) eLast.scrollIntoView(false); |
| 566 | else this.scrollMessagesTo(1); |
| 567 | return this; |
| 568 | }, |
| 569 | /** |
| @@ -896,11 +897,10 @@ | |
| 896 | const setupHashtags = function f(elem){ |
| 897 | if(!f.$click){ |
| 898 | f.$click = function(ev){ |
| 899 | const tag = ev.target.dataset.hashtag; |
| 900 | if(tag){ |
| 901 | console.debug("hashtag = ",tag); |
| 902 | Chat.setHashtagFilter( |
| 903 | tag===Chat.filter.hashtag.activeTag |
| 904 | ? false : tag |
| 905 | ); |
| 906 | } |
| @@ -1514,10 +1514,11 @@ | |
| 1514 | const btnPreview = Chat.e.btnPreview; |
| 1515 | Chat.setPreviewText = function(t){ |
| 1516 | this.setCurrentView(this.e.viewPreview); |
| 1517 | this.e.previewContent.innerHTML = t; |
| 1518 | this.e.viewPreview.querySelectorAll('a').forEach(addAnchorTargetBlank); |
| 1519 | this.e.inputCurrent.focus(); |
| 1520 | }; |
| 1521 | Chat.e.viewPreview.querySelector('#chat-preview-close'). |
| 1522 | addEventListener('click', ()=>Chat.setCurrentView(Chat.e.viewMessages), false); |
| 1523 | let previewPending = false; |
| 1524 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -560,10 +560,11 @@ | |
| 560 | e.classList.add('hidden'); |
| 561 | } |
| 562 | }); |
| 563 | D.removeClass(this.e.btnClearFilter, 'hidden'); |
| 564 | } |
| 565 | this.setCurrentView(this.e.viewMessages); |
| 566 | if(eLast) eLast.scrollIntoView(false); |
| 567 | else this.scrollMessagesTo(1); |
| 568 | return this; |
| 569 | }, |
| 570 | /** |
| @@ -896,11 +897,10 @@ | |
| 897 | const setupHashtags = function f(elem){ |
| 898 | if(!f.$click){ |
| 899 | f.$click = function(ev){ |
| 900 | const tag = ev.target.dataset.hashtag; |
| 901 | if(tag){ |
| 902 | Chat.setHashtagFilter( |
| 903 | tag===Chat.filter.hashtag.activeTag |
| 904 | ? false : tag |
| 905 | ); |
| 906 | } |
| @@ -1514,10 +1514,11 @@ | |
| 1514 | const btnPreview = Chat.e.btnPreview; |
| 1515 | Chat.setPreviewText = function(t){ |
| 1516 | this.setCurrentView(this.e.viewPreview); |
| 1517 | this.e.previewContent.innerHTML = t; |
| 1518 | this.e.viewPreview.querySelectorAll('a').forEach(addAnchorTargetBlank); |
| 1519 | setupHashtags(this.e.previewContent)/*arguable, for usability reasons*/; |
| 1520 | this.e.inputCurrent.focus(); |
| 1521 | }; |
| 1522 | Chat.e.viewPreview.querySelector('#chat-preview-close'). |
| 1523 | addEventListener('click', ()=>Chat.setCurrentView(Chat.e.viewMessages), false); |
| 1524 | let previewPending = false; |
| 1525 |