1 (function( $, app, i18n ) {
5 ui.SidebarSection = ui.AbstractWidget.extend({
14 this.el = $.joey( this._main_template() );
15 this.body = this.el.children(".uiSidebarSection-body");
16 this.config.open && ( this.el.addClass("shown") && this.body.css("display", "block") );
18 _showSection_handler: function( ev ) {
19 var shown = $( ev.target ).closest(".uiSidebarSection")
21 .children(".uiSidebarSection-body").slideToggle(200, function() { this.fire("animComplete", this); }.bind(this))
24 this.fire(shown ? "show" : "hide", this);
26 _showHelp_handler: function( ev ) {
27 new ui.HelpPanel({ref: this.config.help});
30 _main_template: function() { return (
31 { tag: "DIV", cls: "uiSidebarSection", children: [
32 (this.config.title && { tag: "DIV", cls: "uiSidebarSection-head", onclick: this._showSection_handler, children: [
34 ( this.config.help && { tag: "SPAN", cls: "uiSidebarSection-help pull-right", onclick: this._showHelp_handler, text: i18n.text("General.HelpGlyph") } )
36 { tag: "DIV", cls: "uiSidebarSection-body", children: [ this.config.body ] }
41 })( this.jQuery, this.app, this.i18n );