From a5550322ba531fb53076acd118a787d765575b6e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 6 Sep 2008 14:23:20 +0100 Subject: [PATCH] new hotkey: c m (toggle category reorder mode) --- feedlist.js | 16 +++++++++++++++- help/3.php | 1 + tt-rss.js | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/feedlist.js b/feedlist.js index 98d5f5a0..6eb7312f 100644 --- a/feedlist.js +++ b/feedlist.js @@ -10,6 +10,20 @@ var mouse_x = 0; var resize_enabled = false; var counters_last_request = 0; +function toggle_sortable_feedlist(enabled) { + try { + + if (enabled) { + Sortable.create('feedList', {onChange: feedlist_dragsorted, only: "feedCat"}); + } else { + Sortable.destroy('feedList'); + } + + } catch (e) { + exception_error("toggle_sortable_feedlist", e); + } +} + function viewCategory(cat) { active_feed_is_cat = true; viewfeed(cat, '', true); @@ -382,7 +396,7 @@ function feedlist_init() { init_collapsable_feedlist(getInitParam("theme")); - Sortable.create('feedList', {onChange: feedlist_dragsorted, only: "feedCat"}); + toggle_sortable_feedlist(isFeedlistSortable()); } catch (e) { exception_error("feedlist/init", e); diff --git a/help/3.php b/help/3.php index 76c87c0d..f6afb857 100644 --- a/help/3.php +++ b/help/3.php @@ -28,6 +28,7 @@ c f c s + c m ? diff --git a/tt-rss.js b/tt-rss.js index 2bbe782c..a63ccacb 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -18,6 +18,11 @@ var init_params = new Object(); var ver_offset = 0; var hor_offset = 0; var feeds_sort_by_unread = false; +var feedlist_sortable_enabled = false; + +function isFeedlistSortable() { + return feedlist_sortable_enabled; +} function tagsAreDisplayed() { return display_tags; @@ -1315,6 +1320,17 @@ function hotkey_handler(e) { } } + if (keycode == 77) { // m + feedlist_sortable_enabled = !feedlist_sortable_enabled; + if (feedlist_sortable_enabled) { + notify_info("Category reordering enabled"); + toggle_sortable_feedlist(true); + } else { + notify_info("Category reordering disabled"); + toggle_sortable_feedlist(false); + } + } + } /* Prefix g */ -- 2.39.5