]> granicus.if.org Git - docbook-dsssl/commitdiff
If an user moved to another page by clicking on a toc link, and then clicked on ...
authorKasun Gajasinghe <kasunbg@gmail.com>
Sat, 28 Jan 2012 16:39:29 +0000 (16:39 +0000)
committerKasun Gajasinghe <kasunbg@gmail.com>
Sat, 28 Jan 2012 16:39:29 +0000 (16:39 +0000)
search should be performed if the cookie textToSearch is not empty.

xsl/webhelp/template/common/main.js
xsl/webhelp/xsl/webhelp.xsl

index fd4c4e4ab31a3044c91f585933123ad877cd68b0..9b8e185fa998d7be83064e9e643f6ab01888c344 100644 (file)
@@ -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
  */
index bddee03089e740859bb2286da49efec8f56e044d..af4169cd909af46c6dbdb893c6c19e9c8d167b46 100644 (file)
@@ -765,7 +765,7 @@ border: none; background: none; font-weight: none; color: none; }
                                 </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'"/>