(function($) { $.concrete('ss', function($){ /** * @class All forms in the right content panel should have closeable jQuery UI style titles. * @name ss.contentPanel.form */ $('#contentPanel form').concrete(/** @lends ss.contentPanel.form */{ onmatch: function() { // Style as title bar this.find(':header:first').titlebar({ closeButton:true }); // The close button should close the east panel of the layout this.find(':header:first .ui-dialog-titlebar-close').bind('click', function(e) { $('body.CMSMain').concrete('ss').MainLayout().close('east'); return false; }); this._super(); } }); /** * @class Control the site tree filter. * Toggles search form fields based on a dropdown selection, * similar to "Smart Search" criteria in iTunes. * @name ss.Form_SeachTreeForm */ $('#Form_SearchTreeForm').concrete(/** @lends ss.Form_SeachTreeForm */{ /** * @type DOMElement */ SelectEl: null, onmatch: function() { var self = this; // only the first field should be visible by default this.find('.field').not(':first').hide(); // generate the field dropdown this.setSelectEl($('') .appendTo(this.find('fieldset:first')) .bind('change', function(e) {self._addField(e);}) ); this._setOptions(); this._super(); }, _setOptions: function() { var self = this; // reset existing elements self.getSelectEl().find('option').remove(); // add default option // TODO i18n jQuery('').appendTo(self.getSelectEl()); // populate dropdown values from existing fields this.find('.field').each(function() { $('