From bb192dd0a369a1d8f6219fea1349bc7040c11e1d Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 7 Oct 2014 14:45:15 -0400 Subject: [PATCH 1/2] UX: Remove sortable column from "Topic" and "Users" column. --- .../javascripts/discourse/templates/discovery/topics.hbs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/discovery/topics.hbs index eb4076efb..9b5cd67a1 100644 --- a/app/assets/javascripts/discourse/templates/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/templates/discovery/topics.hbs @@ -37,17 +37,13 @@ {{/if}} {{/if}} - {{#sortable-heading sortBy="default" action="changeSort" order=order ascending=ascending}} - {{i18n topic.title}} - {{/sortable-heading}} + {{#sortable-heading}} {{i18n topic.title}} {{/sortable-heading}} {{#unless controller.hideCategory}} {{#sortable-heading sortBy="category" action="changeSort" order=order ascending=ascending}} {{i18n category_title}} {{/sortable-heading}} {{/unless}} - {{#sortable-heading sortBy="posters" action="changeSort" order=order ascending=ascending}} - {{i18n users}} - {{/sortable-heading}} + {{#sortable-heading}} {{i18n users}} {{/sortable-heading}} {{#sortable-heading sortBy="posts" number=true action="changeSort" order=order ascending=ascending}} {{i18n posts}} {{/sortable-heading}} From e20c82436d62e0abdfefba8eb698d25f41c352e8 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 7 Oct 2014 15:19:17 -0400 Subject: [PATCH 2/2] FIX: Clicking "Latest" while ordering by a column should reset the order. --- .../discourse/controllers/discovery/topics.js.es6 | 2 ++ app/assets/javascripts/discourse/lib/url.js | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 index 7c356c7c8..a25502d66 100644 --- a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 @@ -37,6 +37,8 @@ var controllerOpts = { var filter = this.get('model.filter'), self = this; + this.setProperties({ order: 'default', ascending: false }); + // Don't refresh if we're still loading if (this.get('controllers.discovery.loading')) { return; } diff --git a/app/assets/javascripts/discourse/lib/url.js b/app/assets/javascripts/discourse/lib/url.js index b7fe81d1a..046244979 100644 --- a/app/assets/javascripts/discourse/lib/url.js +++ b/app/assets/javascripts/discourse/lib/url.js @@ -250,7 +250,10 @@ Discourse.URL = Em.Object.createWithMixins({ navigatedToHome: function(oldPath, path) { var homepage = Discourse.Utilities.defaultHomepage(); - if (window.history && window.history.pushState && path === "/" && (oldPath === "/" || oldPath === "/" + homepage)) { + if (window.history && + window.history.pushState && + (path === "/" || path === "/" + homepage) && + (oldPath === "/" || oldPath === "/" + homepage)) { this.appEvents.trigger('url:refresh'); return true; }