diff --git a/airtime_mvc/application/controllers/NewPlaylistController.php b/airtime_mvc/application/controllers/NewPlaylistController.php index 01ec5dff5..217f21943 100644 --- a/airtime_mvc/application/controllers/NewPlaylistController.php +++ b/airtime_mvc/application/controllers/NewPlaylistController.php @@ -539,14 +539,16 @@ class NewPlaylistController extends Zend_Controller_Action $result['html'] = $this->createFullResponse($bl, true, true); $result['result'] = 0; } else { - $this->view->obj = $bl; - $this->view->id = $bl->getId(); $this->view->form = $form; $this->view->unsavedName = $params['name']; $this->view->unsavedDesc = $params['description']; $viewPath = 'playlist/_smart-block.phtml'; + $this->view->obj = $bl; + $this->view->id = $bl->getId(); $result['html'] = $this->view->render($viewPath); $result['result'] = 1; + $result['type'] = "sb"; + $result['id'] = $bl->getId(); } } else if ($params['type'] == 'playlist') { $this->setPlaylistNameDescAction(); diff --git a/airtime_mvc/public/css/_showbuilder.css b/airtime_mvc/public/css/_showbuilder.css index 1b3da7eef..a580b5152 100644 --- a/airtime_mvc/public/css/_showbuilder.css +++ b/airtime_mvc/public/css/_showbuilder.css @@ -549,8 +549,6 @@ textarea { flex: 1 auto; padding: 0; - /*margin-right: 10px;*/ - /*text-align: center;*/ background: #353535; border: 1px solid #242424; @@ -663,15 +661,19 @@ textarea { text-align: center; } +th.library_checkbox { + text-align: center !important; +} + .datatable tr td { /*, .datatable tr th {*/ line-height: 28px; font-size: 14px; padding: 5px; } -.datatable tr[class$='selected'] td, +.datatable tr[class*='selected'] td, .datatable tr.sb-now-playing td { - color: #efefef; + color: #000; } .datatable tr, .datatable td, @@ -687,6 +689,11 @@ textarea { position: fixed !important; } +.datatable .ui-state-highlight, .spl_sortable .ui-state-highlight { + background: rgba(255, 93, 26, .6); + border: none; +} + /* Uploads/Dropzone */ #upload_form { diff --git a/airtime_mvc/public/js/airtime/library/_library.js b/airtime_mvc/public/js/airtime/library/_library.js index f4d36bf83..877749cd1 100644 --- a/airtime_mvc/public/js/airtime/library/_library.js +++ b/airtime_mvc/public/js/airtime/library/_library.js @@ -287,10 +287,14 @@ var AIRTIME = (function(AIRTIME) { mod.checkItem = function($el) { $el.find(".library_checkbox > input").prop('checked', true); + $("#super-checkbox").prop("checked", true); }; mod.uncheckItem = function($el) { $el.find(".library_checkbox > input").prop('checked', false); + if ($("." + LIB_SELECTED_CLASS.length == 0)) { + $("#super-checkbox").prop("checked", false); + } }; mod.highlightItem = function($el) { @@ -362,20 +366,23 @@ var AIRTIME = (function(AIRTIME) { mod.checkToolBarIcons(); }; + mod.fnRedraw = function() { + oTable.fnStandingRedraw(); + }; + mod.fnDeleteItems = function(aMedia) { //Prevent the user from spamming the delete button while the AJAX request is in progress AIRTIME.button.disableButton("btn-group #sb-trash", false); var openTabObjectIds = $(".obj_id"), mediaIds = []; for (var i in aMedia) { - mediaIds.push(aMedia[i].id.toString()); + mediaIds.push(parseInt(aMedia[i].id)); } openTabObjectIds.each(function(i, el) { - var v = $(el).val(); + var v = parseInt($(el).val()); if ($.inArray(v, mediaIds) > -1) { - AIRTIME.playlist.fnOpenPlaylist({id: v}); - AIRTIME.playlist.closeTab(); + AIRTIME.playlist.closeTab($(el).closest(".pl-content").attr("tab-id")); } }); @@ -841,9 +848,19 @@ var AIRTIME = (function(AIRTIME) { } }); + $libTable.find("thead").on("click", "th > input[type='checkbox']", function(ev) { + if ($(this).is(":checked")) { + AIRTIME.library.selectCurrentPage(); + $(this).prop("checked", true); + } else { + AIRTIME.library.selectNone(); + $(this).prop("checked", false); + } + }); + // begin context menu initialization. $.contextMenu({ - selector: '#library_display tr', + selector: '#library_display tr:has(td)', trigger: "right", build: function($el, e) { diff --git a/airtime_mvc/public/js/airtime/library/_spl.js b/airtime_mvc/public/js/airtime/library/_spl.js index 3a56b8977..a9912145a 100644 --- a/airtime_mvc/public/js/airtime/library/_spl.js +++ b/airtime_mvc/public/js/airtime/library/_spl.js @@ -443,7 +443,7 @@ var AIRTIME = (function(AIRTIME){ } $tabCount++; - var wrapper = "