Rename current_view -> apply_view

And related cleanups.

(imported from commit 4b1a7e7ef19b17c0887e2864f7cc2121eeda361e)
This commit is contained in:
Keegan McAllister
2012-09-06 13:52:53 -04:00
parent 1fa40e515c
commit 59ab88f886

View File

@@ -279,7 +279,7 @@ function home_view(element) {
var current_view_predicate = home_view; var current_view_predicate = home_view;
function current_view(element) { function apply_view(element) {
if (current_view_predicate(element)) { if (current_view_predicate(element)) {
element.show(); element.show();
} else { } else {
@@ -291,8 +291,8 @@ function do_narrow(description, filter_function) {
// We want the zephyr on which the narrow happened to stay in the same place if possible. // We want the zephyr on which the narrow happened to stay in the same place if possible.
var old_top = $("#main_div").offset().top - get_selected_zephyr_row().offset().top; var old_top = $("#main_div").offset().top - get_selected_zephyr_row().offset().top;
current_view_predicate = filter_function; current_view_predicate = filter_function;
$("tr").each(function() { $("tr").each(function () {
current_view($(this)) apply_view($(this));
}); });
select_zephyr(selected_zephyr_id); select_zephyr(selected_zephyr_id);
@@ -421,7 +421,7 @@ function add_message(index, zephyr) {
var new_tr = $('<tr />').attr('id', zephyr.id); var new_tr = $('<tr />').attr('id', zephyr.id);
$('#table').append(new_tr); $('#table').append(new_tr);
new_tr.append(ich.zephyr(zephyr)); new_tr.append(ich.zephyr(zephyr));
current_view(new_tr); apply_view(new_tr);
} }
$(function () { $(function () {