Make button object to be a <button> by default

pull/5838/head
Aleksander Machniak 8 years ago
parent 5b57043cbf
commit cc10cbe039

@ -1333,7 +1333,7 @@ EOF;
}
}
else {
$attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $attrib['imageact']) ? 'image' : 'link';
$attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $attrib['imageact']) ? 'image' : 'button';
}
$command = $attrib['command'];
@ -1474,6 +1474,17 @@ EOF;
$out = html::tag('input', $attrib, null, array('type', 'value', 'onclick', 'id', 'class', 'style', 'tabindex', 'disabled'));
}
else {
if ($attrib['label']) {
$attrib['value'] = $attrib['label'];
}
if ($attrib['command']) {
$attrib['disabled'] = 'disabled';
}
$content = isset($attrib['content']) ? $attrib['content'] : $attrib['label'];
$out = html::tag('button', $attrib, $content, array('type', 'value', 'onclick', 'id', 'class', 'style', 'tabindex', 'disabled'));
}
// generate html code for button
if ($btn_content) {

@ -7328,7 +7328,7 @@ function rcube_webmail()
obj.className = button[state];
}
// disable/enable input buttons
if (button.type == 'input') {
if (button.type == 'input' || button.type == 'button') {
obj.disabled = state == 'pas';
}
else if (button.type == 'uibutton') {

@ -1395,7 +1395,7 @@ function rcmail_settings_tabs($attrib)
$action['href'] = $RCMAIL->url(array('_action' => $action['action']));
}
$button = $OUTPUT->button($action);
$button = $OUTPUT->button($action + array('type' => 'link'));
$attr = $attrib;
$cmd = $action['action'] ?: $action['command'];

Loading…
Cancel
Save