From 10690c19da72ebdb9be2ebe220681528bdec81c7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 7 Mar 2011 15:24:49 +0300 Subject: [PATCH] simplify adding/removing labels manually; simplify headline popup menu --- viewfeed.js | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/viewfeed.js b/viewfeed.js index 7c2d8816..2cad5afb 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -2168,20 +2168,12 @@ function initHeadlinesMenu() { }); - if (!isCdmMode()) +/* if (!isCdmMode()) menu.addChild(new dijit.MenuItem({ label: __("View article"), onClick: function(event) { view(this.getParent().callerRowId); - }})); - - menu.addChild(new dijit.MenuItem({ - label: __("View in a new tab"), - onClick: function(event) { - hlOpenInNewTab(event, this.getParent().callerRowId); - }})); - - menu.addChild(new dijit.MenuSeparator()); + }})); */ menu.addChild(new dijit.MenuItem({ label: __("Open original article"), @@ -2189,13 +2181,22 @@ function initHeadlinesMenu() { openArticleInNewWindow(this.getParent().callerRowId); }})); + menu.addChild(new dijit.MenuItem({ + label: __("View in a tt-rss tab"), + onClick: function(event) { + hlOpenInNewTab(event, this.getParent().callerRowId); + }})); + +// menu.addChild(new dijit.MenuSeparator()); + var labels = dijit.byId("feedTree").model.getItemsInCategory(-2); if (labels) { menu.addChild(new dijit.MenuSeparator()); - var labelsMenu = new dijit.Menu({ownerMenu: menu}); + var labelAddMenu = new dijit.Menu({ownerMenu: menu}); + var labelDelMenu = new dijit.Menu({ownerMenu: menu}); labels.each(function(label) { var id = label.id[0]; @@ -2204,21 +2205,34 @@ function initHeadlinesMenu() { bare_id = -11-bare_id; - labelsMenu.addChild(new dijit.MenuItem({ + labelAddMenu.addChild(new dijit.MenuItem({ label: name, labelId: bare_id, onClick: function(event) { - //console.log(this.labelId); - //console.log(this.getParent().ownerMenu.callerRowId); selectionAssignLabel(this.labelId, [this.getParent().ownerMenu.callerRowId]); }})); + + labelDelMenu.addChild(new dijit.MenuItem({ + label: name, + labelId: bare_id, + onClick: function(event) { + selectionRemoveLabel(this.labelId, + [this.getParent().ownerMenu.callerRowId]); + }})); + }); menu.addChild(new dijit.PopupMenuItem({ - label: __("Labels"), - popup: labelsMenu, + label: __("Assign label"), + popup: labelAddMenu, + })); + + menu.addChild(new dijit.PopupMenuItem({ + label: __("Remove label"), + popup: labelDelMenu, })); + } menu.startup(); -- 2.39.5