Skip to main content

Search and Top Navigation

#5425 closed bug (worksforme)

Opened March 25, 2010 11:19AM UTC

Closed March 26, 2010 01:16AM UTC

Last modified October 11, 2012 09:15PM UTC

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@ikt.es, scabria@ikt.es
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 March 25, 2010 11:23AM UTC.

    The file corrected whith the new method _createButtons

Change History (2)

Changed March 26, 2010 01:16AM UTC by scottgonzalez comment:1

resolution: → worksforme
status: newclosed

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

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:2

cc: gruiz@ikt.es,scabria@ikt.esgruiz@ikt.es, scabria@ikt.es
milestone: TBD

Milestone TBD deleted