
;;

(function($){
	var media = wp.media;
	media.view.Settings.Gallery = media.view.Settings.Gallery.extend({
		render: function() {
			var el = this.$el;
			media.view.Settings.prototype.render.apply( this, arguments );
			el.append( media.template( 'gallery-settings-rhg' ) );            
			//--
			el.find('select.rhg_effect').change(function(e){
				columns = el.find('select.columns').parent();
				if( ''==$(this).val() ){
					columns.show();
				}else{
					columns.hide();
				}
			});
			//todo find an appropiate callback for this:
			setTimeout("jQuery('select.rhg_effect').trigger('change')",200);
			//--
			media.gallery.defaults.rhg_effect = '';
			this.update.apply( this, ['rhg_effect'] );
			this.update.apply( this, ['size'] );
			return this;
		}
	});
})(jQuery);