You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ry...@apache.org on 2012/04/12 19:21:09 UTC

svn commit: r1325390 - /lucene/dev/trunk/solr/webapp/web/js/scripts/query.js

Author: ryan
Date: Thu Apr 12 17:21:09 2012
New Revision: 1325390

URL: http://svn.apache.org/viewvc?rev=1325390&view=rev
Log:
SOLR-3325: linking to query UI with parameters will execute them

Modified:
    lucene/dev/trunk/solr/webapp/web/js/scripts/query.js

Modified: lucene/dev/trunk/solr/webapp/web/js/scripts/query.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/scripts/query.js?rev=1325390&r1=1325389&r2=1325390&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/scripts/query.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/scripts/query.js Thu Apr 12 17:21:09 2012
@@ -95,16 +95,7 @@ sammy.get
                 ? fieldset.addClass( 'expanded' )
                 : fieldset.removeClass( 'expanded' );
             }
-          )
-
-        for( var key in context.params )
-        {
-          if( 'string' === typeof context.params[key] )
-          {
-            $( '[name="' + key + '"]', query_form )
-              .val( context.params[key] );
-          }
-        }
+          );
 
         query_form
           .die( 'submit' )
@@ -149,6 +140,23 @@ sammy.get
               return false;
             }
           );
+
+        var fields = 0;
+        for( var key in context.params )
+        {
+          if( 'string' === typeof context.params[key] )
+          {
+            fields++;
+            $( '[name="' + key + '"]', query_form )
+              .val( context.params[key] );
+          }
+        }
+
+        if( 0 !== fields )
+        {
+          query_form
+            .trigger( 'submit' );
+        }
       }
     );
   }