Skip to main content

Search and Top Navigation

#8485 closed bug (duplicate)

Opened August 10, 2012 09:31AM UTC

Closed August 10, 2012 12:46PM UTC

Last modified August 10, 2012 12:46PM UTC

dialog('option', 'buttions', [...]) doesn't display labels with jquery 1.8.0

Reported by: marianoguerra Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.dialog Version: 1.8.22
Keywords: Cc:
Blocked by: Blocking:
Description

link to gist with examples and description

https://gist.github.com/3312762

link to jsfiddle examples

test in your machine

  • clone it (git clone git://gist.github.com/3312762.git gist-3312762)
  • open with-jq-172.html
  • open with-jq-180.html
  • click on the button on both

expected result

both dialogs should have buttons with labels

result

with 1.7.2 it has labels, with 1.8.0 it doesn't

tested on

  • ubuntu 12.04
  • latest stable firefox, chrome, opera and chromium
Attachments (0)
Change History (4)

Changed August 10, 2012 09:45AM UTC by marianoguerra comment:1

it seems it's fixed on master, I cloned the repo and changed jquery version to 1.8.0 and it works there.

it doesn't work in branch 1-8-stable

Changed August 10, 2012 10:04AM UTC by marianoguerra comment:2

this change in branch 1-8-stable fixes the problem

diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 3d32468..8bc351f 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -396,8 +396,9 @@ $.widget("ui.dialog", {
                                $.each( props, function( key, value ) {
                                        if ( key === "click" ) {
                                                return;
-                                       }
-                                       if ( key in attrFn ) {
+                                       } else if ( key === "text" ) {
+                        button.html(value);
+                    } else if ( key in attrFn ) {
                                                button[ key ]( value );
                                        } else {
                                                button.attr( key, value );

PS: this is my first patch to a jquery project so I may do something wrong :D

Changed August 10, 2012 12:46PM UTC by scottgonzalez comment:3

resolution: → duplicate
status: newclosed

Changed August 10, 2012 12:46PM UTC by scottgonzalez comment:4

Duplicate of #8484.