Skip to content
Snippets Groups Projects
Commit 928d5e73 authored by Devin Carlson's avatar Devin Carlson
Browse files

Issue #3426790: Backport #2640464 - Links styled as buttons not placed inside Dialog's button pane

parent 798964f1
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@
*/
prepareDialogButtons: function ($dialog) {
var buttons = [];
var $buttons = $dialog.find('.form-actions input[type=submit]');
var $buttons = $dialog.find('.form-actions input[type=submit], .form-actions a.button');
$buttons.each(function () {
// Hidden form buttons need special attention. For browser consistency,
// the button needs to be "visible" in order to have the enter key fire
......@@ -75,14 +75,22 @@
width: 0,
height: 0,
padding: 0,
border: 0
border: 0,
overflow: 'hidden'
});
buttons.push({
'text': $originalButton.html() || $originalButton.attr('value'),
'class': $originalButton.attr('class'),
'click': function (e) {
$originalButton.trigger('mousedown').trigger('mouseup').trigger('click');
e.preventDefault();
// If the original button is an anchor tag, triggering the "click"
// event will not simulate a click. Use the click method instead.
if ($originalButton.is('a')) {
$originalButton[0].click();
}
else {
$originalButton.trigger('mousedown').trigger('mouseup').trigger('click');
e.preventDefault();
}
}
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment