From: Andrew Dolgov Date: Sat, 6 Sep 2008 13:23:20 +0000 (+0100) Subject: new hotkey: c m (toggle category reorder mode) X-Git-Tag: 1.2.27~24 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a5550322ba531fb53076acd118a787d765575b6e;p=tt-rss.git new hotkey: c m (toggle category reorder mode) --- 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 */