Author: sevein
Date: Wed Apr 25 10:18:07 2012
New Revision: 11513

Log:
Issue 2288. Add some basic js code to handle advanced search widget

Modified:
   branches/2.0/js/dominion.js

Modified: branches/2.0/js/dominion.js
==============================================================================
--- branches/2.0/js/dominion.js Wed Apr 25 10:13:36 2012        (r11512)
+++ branches/2.0/js/dominion.js Wed Apr 25 10:18:07 2012        (r11513)
@@ -433,4 +433,49 @@
       }
     });
 
+  /****
+   ****
+   ****  Advanced search
+   ****
+   ****/
+
+  var AdvancedSearch = function (element)
+    {
+      this.$element = $(element);
+      this.$content = this.$element.find('#content');
+      this.$criteria = this.$element.find('.criteria');
+
+      this.init();
+    };
+
+  AdvancedSearch.prototype = {
+
+    constructor: AdvancedSearch,
+
+    init: function()
+    {
+      this.$element.find('.add-criteria > a')
+        .on('click', $.proxy(this.addCriteria, this));
+    },
+
+    addCriteria: function (event)
+    {
+      event.preventDefault();
+
+      var h = this.$criteria.eq(0).height();
+
+      this.$content.animate({ height: '+=' + h }, 200);
+    }
+
+  };
+
+  $(function ()
+    {
+      var $advancedSearch = $('#advanced-search');
+      if (0 < $advancedSearch.length)
+      {
+        new AdvancedSearch($advancedSearch.get(0));
+      }
+    });
+
 })(window.jQuery);

-- 
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