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; return;
} }
newTab.tab.on("click", function() { 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')) { if (!$(this).hasClass('active')) {
AIRTIME.showbuilder.switchTab(newTab.pane, newTab.tab); AIRTIME.showbuilder.switchTab(newTab.pane, newTab.tab);
$.post(baseUrl+'playlist/edit', $.post(url, {format: "json", id: newTab.pane.find(".obj_id").val(), type: type});
{format: "json", id: newTab.pane.find(".obj_id").val(), type: newTab.pane.find(".obj_type").val()});
} }
}); });
AIRTIME.playlist.init(); AIRTIME.playlist.init();

View file

@ -224,7 +224,7 @@ function buildScheduleDialog (json, instance_id) {
} }
] ]
}); });
//set the start end times so the builder datatables knows its time range. //set the start end times so the builder datatables knows its time range.
fnServer.start = json.start; fnServer.start = json.start;
fnServer.end = json.end; fnServer.end = json.end;