From 4a2a90c980bb7436150ed82556fdb6f4db3ff138 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Sun, 7 Apr 2019 12:21:52 +0200 Subject: Fix focus issues with hotkeys Since making use of keypress in addition to keydown, hotkeys did not work in certain scenarios, including clicking on the feed tree expanders or empty spaces of the toolbar. This issue is caused by dijit.Tree and dijit.Toolbar implementing the _KeyNavMixin, which explicitly stops propagation of keypress events. This change contains two main fixes plus a smaller hotfix: 1. It overrides _onContainerKeydown and _onContainerKeypress for fox.FeedTree (which inherits from dijit.Tree). 2. It adds fox.Toolbar, which overrides _onContainerKeydown, _onContainerKeypress and focus. This fixes hotkeys being swallowed and the first focusable child receiving focus when clicking on an empty space of the toolbar. 3. It adds the same handling of keydown and keypress to the prefs hotkey handler as is done in the main hotkey handler. --- classes/pref/feeds.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'classes/pref/feeds.php') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index b90fd5848..bb854553d 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1208,7 +1208,7 @@ class Pref_Feeds extends Handler_Protected { print '
'; - print "
"; #toolbar + print "
"; #toolbar print "
execute([$_SESSION['uid']]); - print "
"; + print "
"; print "
". "" . __('Select').""; print "
"; @@ -1506,7 +1506,7 @@ class Pref_Feeds extends Handler_Protected { FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ?"); $sth->execute([$_SESSION['uid']]); - print "
"; + print "
"; print "
". "" . __('Select').""; print "
"; -- cgit v1.2.3 From e38fcd6deac9a63654fb0eb61fffa9ad747e4c50 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Sat, 13 Apr 2019 22:36:15 +0200 Subject: Fix button focus issues This change introduces derived classes for ComboButton, DropDownButton and Select that make sure that buttons do not remain focused after their menus are closed. This allows using hotkeys after closing them. --- classes/pref/feeds.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'classes/pref/feeds.php') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index bb854553d..fbbbdb4f4 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -571,7 +571,7 @@ class Pref_Feeds extends Handler_Protected { print " "; print_feed_cat_select("cat_id", $cat_id, - 'dojoType="dijit.form.Select"'); + 'dojoType="fox.form.Select"'); print ""; } @@ -602,7 +602,7 @@ class Pref_Feeds extends Handler_Protected { print " "; print_select("feed_language", $feed_language, $this::get_ts_languages(), - 'dojoType="dijit.form.Select"'); + 'dojoType="fox.form.Select"'); print ""; } @@ -621,7 +621,7 @@ class Pref_Feeds extends Handler_Protected { print " "; print_select_hash("update_interval", $update_interval, $update_intervals, - 'dojoType="dijit.form.Select"'); + 'dojoType="fox.form.Select"'); print ""; @@ -634,7 +634,7 @@ class Pref_Feeds extends Handler_Protected { print " "; print_select_hash("purge_interval", $purge_interval, $purge_intervals, - 'dojoType="dijit.form.Select" ' . + 'dojoType="fox.form.Select" ' . ((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"')); print ""; @@ -826,7 +826,7 @@ class Pref_Feeds extends Handler_Protected { print " "; print_feed_cat_select("cat_id", false, - 'disabled="1" dojoType="dijit.form.Select"'); + 'disabled="1" dojoType="fox.form.Select"'); $this->batch_edit_cbox("cat_id"); @@ -840,7 +840,7 @@ class Pref_Feeds extends Handler_Protected { print " "; print_select("feed_language", "", $this::get_ts_languages(), - 'disabled="1" dojoType="dijit.form.Select"'); + 'disabled="1" dojoType="fox.form.Select"'); $this->batch_edit_cbox("feed_language"); @@ -859,7 +859,7 @@ class Pref_Feeds extends Handler_Protected { print " "; print_select_hash("update_interval", "", $update_intervals, - 'disabled="1" dojoType="dijit.form.Select"'); + 'disabled="1" dojoType="fox.form.Select"'); $this->batch_edit_cbox("update_interval"); @@ -874,7 +874,7 @@ class Pref_Feeds extends Handler_Protected { print " "; print_select_hash("purge_interval", "", $purge_intervals, - 'disabled="1" dojoType="dijit.form.Select"'); + 'disabled="1" dojoType="fox.form.Select"'); $this->batch_edit_cbox("purge_interval"); @@ -1217,7 +1217,7 @@ class Pref_Feeds extends Handler_Protected { __('Search')."
"; - print "
". + print "
". "" . __('Select').""; print "
"; print "
".__('None')."
"; print "
"; - print "
". + print "
". "" . __('Feeds').""; print "
"; print "
"; if (get_pref('ENABLE_FEED_CATS')) { - print "
". + print "
". "" . __('Categories').""; print "
"; print "
execute([$_SESSION['uid']]); print "
"; - print "
". + print "
". "" . __('Select').""; print "
"; print "
execute([$_SESSION['uid']]); print "
"; - print "
". + print "
". "" . __('Select').""; print "
"; print "
"; print " "; - print_feed_cat_select("cat", false, 'dojoType="dijit.form.Select"'); + print_feed_cat_select("cat", false, 'dojoType="fox.form.Select"'); print ""; } -- cgit v1.2.3