CC-6131 - add div to show when search is active; css tweaks

This commit is contained in:
Duncan Sommerville 2015-09-03 13:41:29 -04:00
parent 888762739e
commit c928627d8b
4 changed files with 39 additions and 9 deletions

View File

@ -7,6 +7,7 @@
<div class="panel-header"> <div class="panel-header">
<div id="advanced-options" class="btn-group"> <div id="advanced-options" class="btn-group">
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown"> <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">
<span id="filter_message"></span>
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<div id="advanced_search" class="advanced_search form-horizontal dropdown-menu"></div> <div id="advanced_search" class="advanced_search form-horizontal dropdown-menu"></div>

View File

@ -161,9 +161,9 @@ div.btn > span {
#library_empty { #library_empty {
display: none; display: none;
font-size: 16px; font-size: 16px;
position: absolute; position: fixed;
width: 100%; /*width: 100%;*/
top: 44%; /*top: 44%;*/
text-align: center; text-align: center;
color: #efefef; color: #efefef;
} }
@ -205,9 +205,9 @@ thead th.ui-state-default:focus {
#advanced_search { #advanced_search {
position: absolute; position: absolute;
left: -420px; left: -450px;
padding: 5px; padding: 5px;
margin-top: -2px; margin-top: 28px;
z-index: 1005; z-index: 1005;
} }
@ -232,12 +232,19 @@ thead th.ui-state-default:focus {
margin-top: 4px; margin-top: 4px;
} }
#filter_message {
border-top: none !important;
text-shadow: none;
}
#advanced-options { #advanced-options {
float: right; float: right;
z-index: 1004; z-index: 1004;
} }
#advanced-options > button { #advanced-options > button {
position: absolute;
right: 0;
background: transparent none; background: transparent none;
color: transparent; color: transparent;
border: none; border: none;
@ -250,6 +257,7 @@ thead th.ui-state-default:focus {
} }
#advanced-options > button > span { #advanced-options > button > span {
color: #000;
border-top: 4px solid #242424; border-top: 4px solid #242424;
} }

View File

@ -88,16 +88,20 @@ var AIRTIME = (function(AIRTIME) {
}); });
// TODO: once the new manual pages are added, change links! // TODO: once the new manual pages are added, change links!
$.getJSON( "ajax/library_placeholders.json", function( data ) { $.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); img.addClass("icon-white " + opts.icon);
$('#library_empty_text').html( $('#library_empty_text').html(
$.i18n._("You haven't added any " + opts.media + ".") $.i18n._("You haven't added any " + opts.media + ".")
+ "<br/>" + $.i18n._(opts.subtext) + "<br/>" + $.i18n._(opts.subtext)
+ "<br/><a target='_blank' href='" + opts.href + "'>" + $.i18n._("Learn about " + opts.media) + "</a>" + "<br/><a target='_blank' href='" + opts.href + "'>" + $.i18n._("Learn about " + opts.media) + "</a>"
);
});
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 { } else {
libEmpty.hide(); 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; return AIRTIME;
}(AIRTIME || {})); }(AIRTIME || {}));
$(window).resize(AIRTIME.library.onResize);

View File

@ -712,9 +712,18 @@ var AIRTIME = (function(AIRTIME) {
"error": handleAjaxError "error": handleAjaxError
}).done(function(data) { }).done(function(data) {
if (data.iTotalRecords > data.iTotalDisplayRecords) { 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_empty').hide();
$('#library_display').find('tr:has(td.dataTables_empty)').show(); $('#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, "fnRowCallback": AIRTIME.library.fnRowCallback,