});
//'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');
}
});
+
+/**
+ * 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
*/
</li>
<xsl:if test="$webhelp.include.search.tab != 'false'">
<li>
- <a href="#searchDiv" style="outline:0;" tabindex="1">
+ <a href="#searchDiv" style="outline:0;" tabindex="1" onclick="doSearch()">
<span class="searchTab">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Search'"/>