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

@ -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 + ".")
+ "<br/>" + $.i18n._(opts.subtext)
+ "<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 {
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);