From c928627d8ba20ee51995d80033bbf893b52e52d5 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Thu, 3 Sep 2015 13:41:29 -0400 Subject: [PATCH] CC-6131 - add div to show when search is active; css tweaks --- .../views/scripts/showbuilder/index.phtml | 1 + airtime_mvc/public/css/dashboard.css | 18 ++++++++++++----- .../library/events/library_showbuilder.js | 20 +++++++++++++++---- .../public/js/airtime/library/library.js | 9 +++++++++ 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/airtime_mvc/application/views/scripts/showbuilder/index.phtml b/airtime_mvc/application/views/scripts/showbuilder/index.phtml index 68c508dcf..b3f90508b 100644 --- a/airtime_mvc/application/views/scripts/showbuilder/index.phtml +++ b/airtime_mvc/application/views/scripts/showbuilder/index.phtml @@ -7,6 +7,7 @@
diff --git a/airtime_mvc/public/css/dashboard.css b/airtime_mvc/public/css/dashboard.css index c30d2e848..3d08be114 100644 --- a/airtime_mvc/public/css/dashboard.css +++ b/airtime_mvc/public/css/dashboard.css @@ -161,9 +161,9 @@ div.btn > span { #library_empty { display: none; font-size: 16px; - position: absolute; - width: 100%; - top: 44%; + position: fixed; + /*width: 100%;*/ + /*top: 44%;*/ text-align: center; color: #efefef; } @@ -205,9 +205,9 @@ thead th.ui-state-default:focus { #advanced_search { position: absolute; - left: -420px; + left: -450px; padding: 5px; - margin-top: -2px; + margin-top: 28px; z-index: 1005; } @@ -232,12 +232,19 @@ thead th.ui-state-default:focus { margin-top: 4px; } +#filter_message { + border-top: none !important; + text-shadow: none; +} + #advanced-options { float: right; z-index: 1004; } #advanced-options > button { + position: absolute; + right: 0; background: transparent none; color: transparent; border: none; @@ -250,6 +257,7 @@ thead th.ui-state-default:focus { } #advanced-options > button > span { + color: #000; border-top: 4px solid #242424; } diff --git a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js index 3459c862d..f378b2d93 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js @@ -88,16 +88,20 @@ var AIRTIME = (function(AIRTIME) { }); // TODO: once the new manual pages are added, change links! $.getJSON( "ajax/library_placeholders.json", function( data ) { - var opts = data[mediaType]; + var opts = data[mediaType], + wrapper = $('#library_display_wrapper').find('.dataTables_scrolling'); img.addClass("icon-white " + opts.icon); $('#library_empty_text').html( $.i18n._("You haven't added any " + opts.media + ".") + "
" + $.i18n._(opts.subtext) + "
" + $.i18n._("Learn about " + opts.media) + "" - ); - }); - libEmpty.show(); + ); + + libEmpty.show(); + libEmpty.css('margin-left', (wrapper.width() / 2) - (libEmpty.width() / 2)); + libEmpty.css('margin-top', (wrapper.height() / 2) - (libEmpty.height() / 2) - 19); + }); } else { libEmpty.hide(); } @@ -373,6 +377,14 @@ var AIRTIME = (function(AIRTIME) { } }; + mod.onResize = function() { + var libEmpty = $('#library_empty'), wrapper = $('#library_display_wrapper').find('.dataTables_scrolling'); + libEmpty.css('margin-left', (wrapper.width() / 2) - (libEmpty.width() / 2)); + libEmpty.css('margin-top', (wrapper.height() / 2) - (libEmpty.height() / 2) - 19); + }; + return AIRTIME; }(AIRTIME || {})); + +$(window).resize(AIRTIME.library.onResize); diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 6355c554b..66e5b6ed7 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -712,9 +712,18 @@ var AIRTIME = (function(AIRTIME) { "error": handleAjaxError }).done(function(data) { if (data.iTotalRecords > data.iTotalDisplayRecords) { + $('#filter_message').text( + $.i18n._("Filtering out ") + (data.iTotalRecords - data.iTotalDisplayRecords) + + $.i18n._(" of ") + data.iTotalRecords + + $.i18n._(" records") + ); $('#library_empty').hide(); $('#library_display').find('tr:has(td.dataTables_empty)').show(); + } else { + $('#filter_message').text(""); } + $('#library_content').find('.dataTables_filter input[type="text"]') + .css('padding-right', $('#advanced-options').find('button').outerWidth()); }); }, "fnRowCallback": AIRTIME.library.fnRowCallback,