From: Kasun Gajasinghe Date: Sat, 28 Jan 2012 16:39:29 +0000 (+0000) Subject: If an user moved to another page by clicking on a toc link, and then clicked on ... X-Git-Tag: release/1.79.1~6^2~571 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42da9508c60e903ac1284d1a6b1268975a810910;p=docbook-dsssl If an user moved to another page by clicking on a toc link, and then clicked on #searchDiv, search should be performed if the cookie textToSearch is not empty. --- diff --git a/xsl/webhelp/template/common/main.js b/xsl/webhelp/template/common/main.js index fd4c4e4ab..9b8e185fa 100644 --- a/xsl/webhelp/template/common/main.js +++ b/xsl/webhelp/template/common/main.js @@ -62,7 +62,7 @@ $(document).ready(function() { }); //'ui-tabs-1' is the cookie name which is used for the persistence of the tabs.(Content/Search tab) - if ($.cookie('ui-tabs-1') === '1') { //search tab is visible + if ($.cookie('ui-tabs-1') === '1') { //search tab is active if ($.cookie('textToSearch') != undefined && $.cookie('textToSearch').length > 0) { document.getElementById('textToSearch').value = $.cookie('textToSearch'); Verifie('searchForm'); @@ -87,6 +87,19 @@ $(document).ready(function() { } }); + +/** + * If an user moved to another page by clicking on a toc link, and then clicked on #searchDiv, + * search should be performed if the cookie textToSearch is not empty. + */ +function doSearch() { +//'ui-tabs-1' is the cookie name which is used for the persistence of the tabs.(Content/Search tab) + if ($.cookie('textToSearch') != undefined && $.cookie('textToSearch').length > 0) { + document.getElementById('textToSearch').value = $.cookie('textToSearch'); + Verifie('searchForm'); + } +} + /** * Synchronize with the tableOfContents */ diff --git a/xsl/webhelp/xsl/webhelp.xsl b/xsl/webhelp/xsl/webhelp.xsl index bddee0308..af4169cd9 100644 --- a/xsl/webhelp/xsl/webhelp.xsl +++ b/xsl/webhelp/xsl/webhelp.xsl @@ -765,7 +765,7 @@ border: none; background: none; font-weight: none; color: none; }
  • - +