From 3e7b0bd435f5af722041a278f26ead7ed91184f8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 23 Aug 2012 23:59:46 +0400 Subject: [PATCH] be more smart with label assignments to selection in headline context menu --- js/viewfeed.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/js/viewfeed.js b/js/viewfeed.js index 4bb56ddf..05b36f2b 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -1930,16 +1930,26 @@ function initHeadlinesMenu() { label: name, labelId: bare_id, onClick: function(event) { - selectionAssignLabel(this.labelId, - [this.getParent().ownerMenu.callerRowId]); + var ids = getSelectedArticleIds2(); + // cast to string + var id = this.getParent().ownerMenu.callerRowId + ""; + + ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id]; + + selectionAssignLabel(this.labelId, ids); }})); labelDelMenu.addChild(new dijit.MenuItem({ label: name, labelId: bare_id, onClick: function(event) { - selectionRemoveLabel(this.labelId, - [this.getParent().ownerMenu.callerRowId]); + var ids = getSelectedArticleIds2(); + // cast to string + var id = this.getParent().ownerMenu.callerRowId + ""; + + ids = ids.size() != 0 && ids.indexOf(id) != -1 ? ids : [id]; + + selectionRemoveLabel(this.labelId, ids); }})); }); -- 2.39.5