Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#5425 closed bug (worksforme)

In the version query-ui-1.8 the dialog buttons lose the styles.

Reported by: gaizkile Owned by:
Priority: major Milestone:
Component: ui.dialog Version: 1.8
Keywords: buttons css lost Cc: gruiz@…, scabria@…
Blocked by: Blocking:

Description

When you open a dialog,the buttons within the dialog pane lose the styles except the hover styles. To solve this problem you need to change the method in the file jquery.ui.dialog.js where the dialog are created. In the next lines it will be shown the lines of the new method corrected.

_createButtons: function(buttons) {
		var self = this,
			hasButtons = false,
			uiDialogButtonPane = $('<div></div>')
				.addClass(
					'ui-dialog-buttonpane ' +
					'ui-widget-content ' +
					'ui-helper-clearfix'
				);

		// if we already have a button pane, remove it
		this.uiDialog.find('.ui-dialog-buttonpane').remove();

		(typeof buttons == 'object' && buttons !== null &&
			$.each(buttons, function() { return !(hasButtons = true); }));
		if (hasButtons) {
			$.each(buttons, function(name, fn) {
				$('<button type="button"></button>')
					.addClass(
						'ui-state-default ' +
						'ui-corner-all'
					)
					.text(name)
					.click(function() { fn.apply(self.element[0], arguments); })
					.hover(
						function() {
							$(this).addClass('ui-state-hover');
						},
						function() {
							$(this).removeClass('ui-state-hover');
						}
					)
					.focus(function() {
						$(this).addClass('ui-state-focus');
					})
					.blur(function() {
						$(this).removeClass('ui-state-focus');
					})
					.appendTo(uiDialogButtonPane);
			});
			uiDialogButtonPane.appendTo(this.uiDialog);
		}
	}

Attachments (1)

jquery.ui.dialog.js (20.4 KB) - added by gaizkile 9 years ago.
The file corrected whith the new method _createButtons

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by gaizkile

Attachment: jquery.ui.dialog.js added

The file corrected whith the new method _createButtons

comment:1 Changed 9 years ago by Scott González

Resolution: worksforme
Status: newclosed

This looks like the 1.7.2 implementation. You're probably just not including the new button plugin.

comment:2 Changed 7 years ago by Scott González

Cc: gruiz@ikt.es,scabria@ikt.esgruiz@ikt.es, scabria@ikt.es
Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.