From 749016a7b41d5eca2010a13a7b96c9ebfdd8380f Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Thu, 21 Jan 2016 19:25:40 +0100 Subject: [PATCH] Fix keyboard shortcuts on profile pages closes #6647 --- Changelog.md | 5 ++++- app/assets/javascripts/app/pages/profile.js | 1 + features/desktop/keyboard_navigation.feature | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index f2e4b22b4..6aa4b03ef 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,7 +4,10 @@ * Internationalize controller rescue\_from text [#6554](https://github.com/diaspora/diaspora/pull/6554) # Bug fixes -Fix plural rules handling more than wanted as "one" [#6630](https://github.com/diaspora/diaspora/pull/6630) +* Fix plural rules handling more than wanted as "one" [#6630](https://github.com/diaspora/diaspora/pull/6630) + +# Features +* Keyboard shortcuts now do work on profile pages as well [#6647](https://github.com/diaspora/diaspora/pull/6647/files) # 0.5.6.0 diff --git a/app/assets/javascripts/app/pages/profile.js b/app/assets/javascripts/app/pages/profile.js index f9f24da73..7849ff4c8 100644 --- a/app/assets/javascripts/app/pages/profile.js +++ b/app/assets/javascripts/app/pages/profile.js @@ -88,6 +88,7 @@ app.pages.Profile = app.views.Base.extend({ if( this.model.get('is_own_profile') ) { app.publisher = new app.views.Publisher({collection : app.stream.items}); } + app.shortcuts = app.shortcuts || new app.views.StreamShortcuts({el: $(document)}); return new view({model: app.stream}); }, diff --git a/features/desktop/keyboard_navigation.feature b/features/desktop/keyboard_navigation.feature index 99e286e0f..aed65c3f6 100644 --- a/features/desktop/keyboard_navigation.feature +++ b/features/desktop/keyboard_navigation.feature @@ -46,3 +46,13 @@ Feature: Keyboard navigation When I press the "J" key somewhere And I press the "C" key somewhere Then the first comment field should be open + + Scenario: navigate downwards on a profile page + When I am on "alice@alice.alice"'s page + And I press the "J" key somewhere + Then post 1 should be highlighted + And I should have navigated to the highlighted post + + When I press the "J" key somewhere + Then post 2 should be highlighted + And I should have navigated to the highlighted post