5 ui.DraggablePanel = ui.AbstractPanel.extend({
7 // title: "" // (required) text for the panel title
14 this.body = $(this._body_template());
15 this.title = $(this._title_template());
16 this.el = $.joey( this._main_template() );
17 this.el.css( { width: this.config.width } );
18 this.dd = new app.ux.DragDrop({
19 pickupSelector: this.el.find(".uiPanel-titleBar"),
22 // open the panel if set in configuration
23 this.config.open && this.open();
26 setBody: function(body) {
27 this.body.empty().append(body);
29 _body_template: function() { return { tag: "DIV", cls: "uiPanel-body", css: { height: this.config.height + (this.config.height === 'auto' ? "" : "px" ) }, children: [ this.config.body ] }; },
30 _title_template: function() { return { tag: "SPAN", cls: "uiPanel-title", text: this.config.title }; },
31 _main_template: function() { return (
32 { tag: "DIV", id: this.id(), cls: this._baseCls, children: [
33 { tag: "DIV", cls: "uiPanel-titleBar", children: [
34 { tag: "DIV", cls: "uiPanel-close", onclick: this._close_handler, text: "x" },
42 })( this.jQuery, this.app );