From 314efc29ee1c1e238eef4062e4a52fb5ba93f5db Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 2 Sep 2012 19:03:22 +0100 Subject: [PATCH] better comments --- Netdisco/public/javascripts/netdisco.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Netdisco/public/javascripts/netdisco.js b/Netdisco/public/javascripts/netdisco.js index 9b191f27..9b8e12da 100644 --- a/Netdisco/public/javascripts/netdisco.js +++ b/Netdisco/public/javascripts/netdisco.js @@ -7,7 +7,8 @@ function do_search (event, tab) { // stop form from submitting normally event.preventDefault(); - // copy current search string to other forms' input box + // each sidebar search form has a hidden copy of the main navbar search + // query. on tab activation, copy this to all hidden sidebars. $('form').find("input[name=q]").each( function() { $(this).val( $(form).find("input[name=q]").val() ); }); @@ -31,6 +32,8 @@ function do_search (event, tab) { // get the form params var query = $(form).serialize(); + // update browser search history with the new query. + // however if it's the same tab, this is a *replace* of the query url. if (window.History && window.History.enabled) { is_from_history_plugin = 1; window.History.replaceState( @@ -64,6 +67,7 @@ function do_search (event, tab) { ); } + // delegate to any [device|search] specific JS code inner_view_processing(tab); } );