Dialog: Partial fix for #3648: Use new CSS framework.

This commit is contained in:
Scott González 2008-12-11 02:45:42 +00:00
parent 9eda8e4cb9
commit 713761c876
2 changed files with 33 additions and 6 deletions

View File

@ -300,7 +300,7 @@ test("buttons", function() {
i++; i++;
}); });
equals(btn.parent().attr('className'), 'ui-dialog-buttonpane', "buttons in container"); ok(btn.parent().hasClass('ui-dialog-buttonpane'), "buttons in container");
btn.trigger("click"); btn.trigger("click");
var newButtons = { var newButtons = {

View File

@ -38,7 +38,9 @@ $.widget("ui.dialog", {
uiDialogContent = this.element uiDialogContent = this.element
.removeAttr('title') .removeAttr('title')
.addClass('ui-dialog-content') .addClass(
'ui-dialog-content ' +
'ui-widget-content')
.wrap('<div/>') .wrap('<div/>')
.wrap('<div/>'), .wrap('<div/>'),
@ -51,18 +53,30 @@ $.widget("ui.dialog", {
}), }),
uiDialogTitlebar = (this.uiDialogTitlebar = $('<div/>')) uiDialogTitlebar = (this.uiDialogTitlebar = $('<div/>'))
.addClass('ui-dialog-titlebar') .addClass(
'ui-dialog-titlebar ' +
'ui-widget-header ' +
'ui-corner-all ' +
'ui-helper-clearfix'
)
.mousedown(function() { .mousedown(function() {
self.moveToTop(); self.moveToTop();
}) })
.prependTo(uiDialogContainer), .prependTo(uiDialogContainer),
uiDialogTitlebarClose = $('<a href="#"/>') uiDialogTitlebarClose = $('<a href="#"/>')
.addClass('ui-dialog-titlebar-close') .addClass(
'ui-dialog-titlebar-close ' +
'ui-corner-all'
)
.attr('role', 'button') .attr('role', 'button')
.appendTo(uiDialogTitlebar), .appendTo(uiDialogTitlebar),
uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>')) uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
.addClass(
'ui-icon ' +
'ui-icon-closethick'
)
.text(options.closeText) .text(options.closeText)
.appendTo(uiDialogTitlebarClose), .appendTo(uiDialogTitlebarClose),
@ -77,7 +91,12 @@ $.widget("ui.dialog", {
uiDialog = (this.uiDialog = uiDialogContainer.parent()) uiDialog = (this.uiDialog = uiDialogContainer.parent())
.appendTo(document.body) .appendTo(document.body)
.hide() .hide()
.addClass('ui-dialog') .addClass(
'ui-dialog ' +
'ui-widget ' +
'ui-widget-content ' +
'ui-corner-all'
)
.addClass(options.dialogClass) .addClass(options.dialogClass)
.css({ .css({
position: 'absolute', position: 'absolute',
@ -101,7 +120,11 @@ $.widget("ui.dialog", {
}), }),
uiDialogButtonPane = (this.uiDialogButtonPane = $('<div/>')) uiDialogButtonPane = (this.uiDialogButtonPane = $('<div/>'))
.addClass('ui-dialog-buttonpane') .addClass(
'ui-dialog-buttonpane ' +
'ui-widget-content ' +
'ui-helper-clearfix'
)
.css({ .css({
position: 'absolute', position: 'absolute',
bottom: 0 bottom: 0
@ -242,6 +265,10 @@ $.widget("ui.dialog", {
uiDialogButtonPane.show(); uiDialogButtonPane.show();
$.each(buttons, function(name, fn) { $.each(buttons, function(name, fn) {
$('<button type="button"></button>') $('<button type="button"></button>')
.addClass(
'ui-state-default ' +
'ui-corner-all'
)
.text(name) .text(name)
.click(function() { fn.apply(self.element[0], arguments); }) .click(function() { fn.apply(self.element[0], arguments); })
.appendTo(uiDialogButtonPane); .appendTo(uiDialogButtonPane);