From 6c6b33b5538922570674bc0595d7d8329ed72688 Mon Sep 17 00:00:00 2001 From: Robb Ebright Date: Fri, 13 Oct 2017 18:54:04 -0400 Subject: [PATCH] fixed jquery javascript regarding datetime select dynamic modification --- .../js/airtime/playlist/smart_blockbuilder.js | 57 ++++++++++++++++--- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js index 047882080..780a7b12d 100644 --- a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js +++ b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js @@ -90,18 +90,26 @@ function setSmartBlockEvents() { var item_to_hide; var prev; var index; - //remove error message from current row, if any var error_element = curr.find('span[class="errors sp-errors"]'); if (error_element.is(':visible')) { error_element.remove(); } + /* In the case that there is only one element we need to remove the + * date_select drop down. + */ + + if (count == 0) { + disableAndHideDateTimeDropdown(curr.find(':first-child'), index); + } + /* assign next row to current row for all rows below and including * the row getting removed */ + + for (var i=0; i