Don't display link numbers at all instead of hiding

This commit is contained in:
Christian Dywan 2010-10-26 21:55:11 +02:00
parent 844bb5aa05
commit 8b7640731d

View file

@ -1839,8 +1839,10 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
script = g_strdup_printf ( script = g_strdup_printf (
"var links = document.getElementsByClassName ('midoriHKD87346');" "var links = document.getElementsByClassName ('midoriHKD87346');"
"var i = %d; var return_key = %d;" "var i = %d; var return_key = %d;"
"if (return_key || typeof links[i * 10] == 'undefined')" "if (return_key || typeof links[i * 10] == 'undefined') {"
" location.href = links[i].parentNode.href;", " for (var j = 0; j < links.length; j++)"
" links[j].style.display = 'none !important';"
" location.href = links[i].parentNode.href; }",
view->find_links, event->keyval == GDK_Return); view->find_links, event->keyval == GDK_Return);
result = sokoke_js_script_eval (js_context, script, NULL); result = sokoke_js_script_eval (js_context, script, NULL);
g_free (script); g_free (script);
@ -1849,8 +1851,8 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
{ {
result = sokoke_js_script_eval (js_context, result = sokoke_js_script_eval (js_context,
"var links = document.getElementsByClassName ('midoriHKD87346');" "var links = document.getElementsByClassName ('midoriHKD87346');"
"for (var i = 0; i < links.length; i++) {" "for (var i = 0; i < links.length; i++)"
" links[i].style.visibility = 'hidden'; }", " links[i].style.display = 'none !important';",
NULL); NULL);
view->find_links = -1; view->find_links = -1;
} }