Browse Source

remove nested forms (fixes #61)

Byron Jones 6 years ago
parent
commit
5f4890dd28

+ 1 - 1
web/logbot.js

@@ -142,7 +142,7 @@ $(function() {
 
     $('#search-submit')
         .click(function() {
-            document.forms[0].submit();
+            document.forms['nav-search'].submit();
         });
 
     if ($('body').hasClass('search')) {

File diff suppressed because it is too large
+ 0 - 0
web/public/static/logbot.min.js


+ 7 - 8
web/templates/layouts/logbot.html.ep

@@ -19,9 +19,6 @@
 
   <noscript><h1>This site requires JavaScript</h1></noscript>
 
-  <form action="/" method="get">
-    <input type="submit" class="hidden">
-
   <div id="sidebar">
 
     <div id="actions">
@@ -181,10 +178,13 @@
     % }
 
     <div id="search-input-container">
-      % if ($channel) {
-        <input type="hidden" name="ch" value="<%= substr($channel, 1) %>">
-      % }
-      <input id="search-nav" type="text" name="q" placeholder="Search<%= ' ' . $channel if $channel %>">
+      <form action="/" method="get" name="nav-search">
+        <input type="submit" class="default-display-none">
+        % if ($channel) {
+          <input type="hidden" name="ch" value="<%= substr($channel, 1) %>">
+        % }
+        <input id="search-nav" type="text" name="q" placeholder="Search<%= ' ' . $channel if $channel %>">
+      </form>
     </div>
     <div id="search-button-container">
       <a id="search-submit" class="button" title="Search">
@@ -238,7 +238,6 @@
     </div>
     <button class="modal-close">&#9587;</button>
   </div>
-  </form>
 
   <div id="not-tiny-screen"></div>
 

+ 2 - 0
web/templates/search.html.ep

@@ -7,6 +7,7 @@
 % my $last_channel = $ch eq '' ? $last_c : $ch;
 
 <div id="search-form">
+  <form action="/" method="get" name="search">
 
   <div class="search-field">
     <div class="search-label">Query</div>
@@ -104,6 +105,7 @@
     </div>
   </div>
 
+  </form>
 </div>
 
 % if ($debug ne '') {

Some files were not shown because too many files changed in this diff