Move inline event handlers to <script>
This commit is contained in:
parent
af1ad47a64
commit
b6cc584f48
|
@ -279,11 +279,11 @@ echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "
|
|||
<?php
|
||||
echo "<td>";
|
||||
echo (support("move_col") ?
|
||||
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return editingAddRow.call(this, 1);'> "
|
||||
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "' onclick='return editingMoveRow.call(this, 1);'> "
|
||||
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "' onclick='return editingMoveRow.call(this, 0);'> "
|
||||
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'> " . script("qsl('input').onclick = partial(editingAddRow, 1);")
|
||||
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'> " . script("qsl('input').onclick = partial(editingMoveRow, 1);")
|
||||
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'> " . script("qsl('input').onclick = partial(editingMoveRow, 0);")
|
||||
: "");
|
||||
echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return editingRemoveRow.call(this, 'fields\$1[field]');\">" : "");
|
||||
echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>" . script("qsl('input').onclick = partial(editingRemoveRow, 'fields\$1[field]');") : "");
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -851,7 +851,7 @@ function cloneNode(el) {
|
|||
var origEls = qsa(selector, el);
|
||||
var cloneEls = qsa(selector, el2);
|
||||
for (var i=0; i < origEls.length; i++) {
|
||||
for (var key in {onchange: 1, onkeydown: 1, onsearch: 1, oninput: 1}) {
|
||||
for (var key in {onchange: 1, onkeydown: 1, onsearch: 1, oninput: 1, onclick: 1}) {
|
||||
if (origEls[i][key]) {
|
||||
cloneEls[i][key] = origEls[i][key];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue