Author: jablko
Date: Tue Sep  1 09:58:10 2009
New Revision: 3137

Log:
Add JavaScript behavior to move search forms to #search-sidebar -- force

Added:
   trunk/web/js/search.js   (contents, props changed)
Modified:
   trunk/apps/qubit/modules/actor/config/view.yml
   trunk/apps/qubit/modules/repository/config/view.yml

Modified: trunk/apps/qubit/modules/actor/config/view.yml
==============================================================================
--- trunk/apps/qubit/modules/actor/config/view.yml      Tue Sep  1 09:49:55 
2009        (r3136)
+++ trunk/apps/qubit/modules/actor/config/view.yml      Tue Sep  1 09:58:10 
2009        (r3137)
@@ -7,6 +7,7 @@
   javascripts: [/sfDrupalPlugin/vendor/drupal/misc/collapse, 
/sfDrupalPlugin/vendor/drupal/misc/textarea, multiDelete]
 
 listSuccess:
+  javascripts: [search]
   components:
     sidebar: []
 

Modified: trunk/apps/qubit/modules/repository/config/view.yml
==============================================================================
--- trunk/apps/qubit/modules/repository/config/view.yml Tue Sep  1 09:49:55 
2009        (r3136)
+++ trunk/apps/qubit/modules/repository/config/view.yml Tue Sep  1 09:58:10 
2009        (r3137)
@@ -2,6 +2,7 @@
   javascripts: [/sfDrupalPlugin/vendor/drupal/misc/collapse, 
/sfDrupalPlugin/vendor/drupal/misc/textarea, multiDelete, multiInstanceSelect, 
multiInstanceInput]
 
 listSuccess:
+  javascripts: [search]
   components:
     sidebar: []
 

Added: trunk/web/js/search.js
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/web/js/search.js      Tue Sep  1 09:58:10 2009        (r3137)
@@ -0,0 +1,21 @@
+Drupal.behaviors.search = {
+  attach: function (context)
+    {
+      $('input.search', context).each(function ()
+        {
+          var input = this;
+
+          $(this.form).hide();
+
+          $(':submit', this.form)
+            .click(function (event)
+              {
+                event.preventDefault();
+
+                $(input).val($('#search-sidebar :text').val());
+
+                $(input.form).submit();
+              })
+            .insertBefore('#search-sidebar :submit');
+        });
+    } };

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to