Author: sevein
Date: Fri Sep 30 15:18:30 2011
New Revision: 9890

Log:
Trillium, cancel click event when search input has not changed

Modified:
   trunk/plugins/qtTrilliumPlugin/js/trillium.js

Modified: trunk/plugins/qtTrilliumPlugin/js/trillium.js
==============================================================================
--- trunk/plugins/qtTrilliumPlugin/js/trillium.js       Fri Sep 30 15:16:58 
2011        (r9889)
+++ trunk/plugins/qtTrilliumPlugin/js/trillium.js       Fri Sep 30 15:18:30 
2011        (r9890)
@@ -38,22 +38,37 @@
             })
           .prependTo('.messages');
 
-        // 
+        // Double title, add class "small" to first one
         $('h1.label').parent('a').prev('h1').addClass('small');
         $('h1.label').prev('h1').addClass('small');
 
+        // Extra edit button for view areas
+        $('body.index #content > .section > .section').each(function()
+          {
+            $this = $(this);
+            $first = $(this).children(':first');
+            if ($first.is('a'))
+            {
+              $first.before($first.clone().addClass('editLink'));
+              $this.css('position', 'relative');
+            }
+          });
+
         // Search box behavior
         $('.search').each(function()
           {
             var $sender = $(this);
             var $input = $sender.find('input[name=query], 
input[name=subquery]');
+            var $submit = $sender.find('input:submit');
 
+            // Capture search box title
             var text = $sender.find('h2, h3').text();
             if (!text)
             {
               text = $sender.find(':submit').val();
             }
 
+            // Add title behavior to search input
             if (!$input
               .focus(function()
                 {
@@ -73,6 +88,17 @@
             {
               $input.val(text);
             }
+
+            $submit.click(function()
+              {
+                if ($input.val() == $(this).val())
+                {
+                  $input.focus();
+
+                  return false;
+                }
+              });
+
           });
 
     });

-- 
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.com/group/qubit-commits?hl=en.

Reply via email to