Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#8485 closed bug (duplicate)

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

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

Change History (4)

comment:1 Changed 6 years ago by marianoguerra

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

comment:2 Changed 6 years ago by marianoguerra

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

comment:3 Changed 6 years ago by Scott González

Resolution: duplicate
Status: newclosed

comment:4 Changed 6 years ago by Scott González

Duplicate of #8484.

Note: See TracTickets for help on using tickets.