diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 73ae6432..374b2a4d 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -640,6 +640,8 @@ tvheadend.idnode_grid = function(panel, conf) if (delBtn) delBtn.setDisabled(s.getCount() == 0); editBtn.setDisabled(s.getCount() != 1); + if (conf.selected) + conf.selected(s); }); /* Top bar */ @@ -700,7 +702,7 @@ tvheadend.idnode_grid = function(panel, conf) disabled : true, handler : function() { var r = select.getSelections(); - if (r) { + if (r && r.length > 0) { var uuids = [] for ( var i = 0; i < r.length; i++ ) uuids.push(r[i].id) diff --git a/src/webui/static/app/mpegts.js b/src/webui/static/app/mpegts.js index 9559dadb..1f7c1bae 100644 --- a/src/webui/static/app/mpegts.js +++ b/src/webui/static/app/mpegts.js @@ -89,21 +89,29 @@ tvheadend.services = function(panel) { var mapButton = new Ext.Toolbar.Button({ tooltip : 'Map services to channels', - iconCls : '', - text : 'Map Services', + iconCls : 'clone', + text : 'Map All', callback: tvheadend.mapServices, disabled : false, }); + var selected = function (s) + { + if (s.getCount() > 0) + mapButton.setText('Map Selected') + else + mapButton.setText('Map All') + } tvheadend.idnode_grid(panel, { - url : 'api/mpegts/service', - comet : 'service', - titleS : 'Service', - titleP : 'Services', - tabIndex: 3, - add : false, - del : false, - tbar : [ mapButton ], - lcol : [ + url : 'api/mpegts/service', + comet : 'service', + titleS : 'Service', + titleP : 'Services', + tabIndex : 3, + add : false, + del : false, + selected : selected, + tbar : [ mapButton ], + lcol : [ { header : 'Play', renderer : function(v, o, r) {