From 9da1e796aaaafe07100ca35ead6419bc4aed1be5 Mon Sep 17 00:00:00 2001 From: posthy Date: Mon, 10 Jun 2013 13:55:36 +0300 Subject: [PATCH 1/2] Added rollup function Added a rollup button to the titlebar of non-modal only dialog widget. In rolled up state only the titlebar is visible, content is hidden. --- ui/jquery.ui.dialog.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index b9475750552..4d485abc597 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -66,6 +66,8 @@ $.widget( "ui.dialog", { } }, resizable: true, + rollupable: false, + rollupText: "rollup/down", show: null, title: null, width: 300, @@ -230,6 +232,24 @@ $.widget( "ui.dialog", { this._trigger("open"); }, + rollupdown: function(event) { + if (!this.isOpen()) + return; + + if (this.isRolledup()) + { + this.uiDialogTitlebarRollup.button("option", "icons", {primary: 'ui-icon-triangle-1-n'}); + this._isRolledup = false; + this.element.show(); + } + else + { + this.uiDialogTitlebarRollup.button("option", "icons", {primary: 'ui-icon-triangle-1-s'}); + this._isRolledup = true; + this.element.hide(); + } + }, + _focusTabbable: function() { // Set focus to the first match: // 1. First element inside the dialog matching [autofocus] @@ -342,6 +362,26 @@ $.widget( "ui.dialog", { } }); + if (!this.options.modal && this.options.rollupable) + { + this.uiDialogTitlebarRollup = $("") + .button({ + label: this.options.rollupText, + icons: { + primary: "ui-icon-triangle-1-n" + }, + text: false + }) + .addClass("ui-dialog-titlebar-rollup") + .appendTo( this.uiDialogTitlebar ); + this._on( this.uiDialogTitlebarRollup, { + click: function ( event ) { + event.preventDefault(); + this.rollupdown( event ); + } + }); + } + // support: IE // Use type="button" to prevent enter keypresses in textboxes from closing the // dialog in IE (#9312) From 54555db50698fbaf96be99e62d4dfcbce5361968 Mon Sep 17 00:00:00 2001 From: posthy Date: Mon, 10 Jun 2013 13:58:00 +0300 Subject: [PATCH 2/2] Added rollup button Added rollup button, left of close button. --- themes/base/jquery.ui.dialog.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/themes/base/jquery.ui.dialog.css b/themes/base/jquery.ui.dialog.css index c5499d8dbb5..1a20ee9f699 100644 --- a/themes/base/jquery.ui.dialog.css +++ b/themes/base/jquery.ui.dialog.css @@ -36,6 +36,15 @@ padding: 1px; height: 20px; } +.ui-dialog .ui-dialog-titlebar-rollup { + position: absolute; + right: 2.2em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} .ui-dialog .ui-dialog-content { position: relative; border: 0;