diff --git a/core/misc/dropbutton/dropbutton.js b/core/misc/dropbutton/dropbutton.js index 62052de..73e9578 100644 --- a/core/misc/dropbutton/dropbutton.js +++ b/core/misc/dropbutton/dropbutton.js @@ -17,15 +17,14 @@ Drupal.behaviors.dropButton = { // Initialize all buttons. for (var i = 0, il = $dropbuttons.length; i < il; i++) { DropButton.dropbuttons.push(new DropButton($dropbuttons[i], settings.dropbutton)); - var buttonWidth = $($dropbuttons[i]).outerWidth(); // If the button is in the column of a table, set the width of the // button to the width of the widest button action text. This prevents // the button text overflowing the table column on narrow screens. if ($($dropbuttons[i]).parents('td').length > 0) { - var $buttonWidth = $('.dropbutton-widget', $dropbuttons[i]).width(); - var $buttonOuterWidth = $($dropbuttons[i]).width(); - $('.dropbutton-widget', $dropbuttons[i]).width($buttonWidth); - $($dropbuttons[i]).width($buttonOuterWidth); + var buttonWidth = $('.dropbutton-widget', $dropbuttons[i]).width(); + var buttonOuterWidth = $($dropbuttons[i]).width(); + $('.dropbutton-widget', $dropbuttons[i]).width(buttonWidth); + $($dropbuttons[i]).width(buttonOuterWidth); // Add a class to the button to show width processing has completed. $($dropbuttons[i]).addClass('width-processed'); }