Fix bug where switching to a webstream tab would throw an error

This commit is contained in:
Duncan Sommerville 2015-09-29 16:26:39 -04:00
parent 3df1081c60
commit d3e9665063
2 changed files with 4 additions and 3 deletions

View file

@ -537,10 +537,11 @@ var AIRTIME = (function(AIRTIME){
return;
}
newTab.tab.on("click", function() {
var type = newTab.pane.find(".obj_type").val(),
url = baseUrl + ((type === "playlist" || type === "block") ? 'playlist' : 'webstream') + '/edit';
if (!$(this).hasClass('active')) {
AIRTIME.showbuilder.switchTab(newTab.pane, newTab.tab);
$.post(baseUrl+'playlist/edit',
{format: "json", id: newTab.pane.find(".obj_id").val(), type: newTab.pane.find(".obj_type").val()});
$.post(url, {format: "json", id: newTab.pane.find(".obj_id").val(), type: type});
}
});
AIRTIME.playlist.init();