Commit 1aa64583 authored by Cottser's avatar Cottser

Issue #2640464 by samuel.mortenson, Chernous_dn, droplet, Wim Leers: Links...

Issue #2640464 by samuel.mortenson, Chernous_dn, droplet, Wim Leers: Links styled as buttons not placed inside Dialog's button pane — prevents "cancel" link/button from showing up
parent 8824b867
......@@ -62,7 +62,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
......@@ -74,14 +74,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();
}
}
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment