git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 01d1fe807ecac5563dd29fe54cc93a07904823e2

click tab when already selected to refresh a view (scrolls to top)

fixes #653
Matt McKegg committed on 10/19/2017, 3:38:14 AM
Parent: f2e05ea5dbafcd1d773de66351a65641b3f48090

Files changed

main-window.jschanged
main-window.jsView
@@ -228,9 +228,13 @@
228228 function tab (name, view) {
229229 var instance = views.get(view)
230230 return h('a', {
231231 'ev-click': function (ev) {
232- if (instance.pendingUpdates && instance.pendingUpdates() && instance.reload) {
232+ var isSelected = views.currentView() === view
233+ var needsRefresh = instance.pendingUpdates && instance.pendingUpdates()
234+
235+ // refresh if tab is clicked when there are pending items or the page is already selected
236+ if ((needsRefresh || isSelected) && instance.reload) {
233237 instance.reload()
234238 }
235239 },
236240 href: view,

Built with git-ssb-web