From 8105c6571c4ced75b30c4c4f79cf47d316185ade Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Mon, 19 Mar 2012 14:48:11 +0100 Subject: [PATCH] CC-3355 : Timeline/Library: Select all in the library, drag to empty show --> nothing is added if something is added after a footer, it will be added to the end of whatever is before the footer. --- airtime_mvc/application/models/ShowBuilder.php | 2 ++ airtime_mvc/public/js/airtime/showbuilder/builder.js | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index 07d4fb684..7eab349a0 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -196,6 +196,8 @@ class Application_Model_ShowBuilder { $row = $this->defaultRowArray; $row["footer"] = true; + $row["instance"] = intval($p_item["si_id"]); + $this->getRowTimestamp($p_item, $row); $showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC")); $contentDT = $this->contentDT; diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index d0839d14b..22c108026 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -515,14 +515,18 @@ var AIRTIME = (function(AIRTIME){ var prev = ui.item.prev(); //can't add items outside of shows. - if (prev.hasClass("sb-footer") - || prev.find("td:first").hasClass("dataTables_empty") + if (prev.find("td:first").hasClass("dataTables_empty") || prev.length === 0) { alert("Cannot schedule outside a show."); ui.item.remove(); return; } + //if item is added after a footer, add the item after the last item in the show. + if (prev.hasClass("sb-footer")) { + prev = prev.prev(); + } + aItemData = []; oPrevData = prev.data("aData");