CC-4036: Timeline -> A new Cursor will be selected when there are 2 shows and we add/delete items in timeline view

-fixed
This commit is contained in:
denise 2012-06-28 17:55:17 -04:00
parent 79513de1ba
commit 38cb439f53
2 changed files with 11 additions and 1 deletions

View File

@ -221,6 +221,7 @@ class Application_Model_ShowBuilder {
$row["title"] = $p_item["show_name"];
$row["instance"] = intval($p_item["si_id"]);
$row["image"] = '';
$row["id"] = -1;
$this->getScheduledStatus($startsEpoch, $endsEpoch, $row);
@ -310,6 +311,7 @@ class Application_Model_ShowBuilder {
$row = $this->defaultRowArray;
$row["footer"] = true;
$row["instance"] = intval($p_item["si_id"]);
$row["id"] = -1;
$this->getRowTimestamp($p_item, $row);
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));

View File

@ -11,6 +11,7 @@ var AIRTIME = (function(AIRTIME){
$lib,
cursors = [],
cursorIds = [];
showInstanceIds = [];
if (AIRTIME.showbuilder === undefined) {
AIRTIME.showbuilder = {};
@ -212,9 +213,15 @@ var AIRTIME = (function(AIRTIME){
checkError(json);
cursorIds = [];
/* We need to keep record of which show the cursor belongs to
* in the case where more than one show is displayed in the show builder
* because header and footer rows have the same id
*/
showInstanceIds = [];
cursors = $(".cursor-selected-row");
for (i = 0; i < cursors.length; i++) {
cursorIds.push(($(cursors.get(i)).attr("id")));
showInstanceIds.push(($(cursors.get(i)).attr("si_id")));
}
oSchedTable.fnDraw();
@ -588,6 +595,7 @@ var AIRTIME = (function(AIRTIME){
else {
$nRow.addClass("sb-allowed");
$nRow.attr("id", aData.id);
$nRow.attr("si_id", aData.instance);
}
//status used to colour tracks.
@ -670,7 +678,7 @@ var AIRTIME = (function(AIRTIME){
//re-highlight selected cursors before draw took place
for (i = 0; i < cursorIds.length; i++) {
$tr = $table.find("tr[id="+cursorIds[i]+"]");
$tr = $table.find("tr[id="+cursorIds[i]+"][si_id="+showInstanceIds[i]+"]");
mod.selectCursor($tr);
}