From: Andrew Dolgov Date: Thu, 23 Aug 2012 19:59:46 +0000 (+0400) Subject: be more smart with label assignments to selection in headline context menu X-Git-Tag: 1.6.0~110 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3e7b0bd435f5af722041a278f26ead7ed91184f8;p=tt-rss.git be more smart with label assignments to selection in headline context menu --- 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); }})); });