mirror of
https://github.com/vrana/adminer.git
synced 2025-08-25 23:36:20 +02:00
Move icons to CSS
This commit is contained in:
@@ -61,8 +61,13 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
.sqlarea { width: 98%; }
|
||||
.sql-footer { margin-bottom: 2.5em; }
|
||||
.explain table { white-space: pre; }
|
||||
.icon { width: 18px; height: 18px; background-color: navy; }
|
||||
.icon { width: 18px; height: 18px; background-color: navy; border: 0; vertical-align: middle; }
|
||||
.icon span { display: none; }
|
||||
.icon:hover { background-color: red; }
|
||||
.icon-up { background-image: url(up.gif); }
|
||||
.icon-down { background-image: url(down.gif); }
|
||||
.icon-plus { background-image: url(plus.gif); }
|
||||
.icon-cross { background-image: url(cross.gif); }
|
||||
.size { width: 7ex; }
|
||||
.help { cursor: help; }
|
||||
.footer { position: sticky; bottom: 0; margin-right: -20px; border-top: 20px solid rgba(255, 255, 255, .7); border-image: linear-gradient(rgba(255, 255, 255, .2), #fff) 100% 0; }
|
||||
|
@@ -249,11 +249,7 @@ function editFields() {
|
||||
* @return boolean false to cancel action
|
||||
*/
|
||||
function editingClick(event) {
|
||||
let el = event.target;
|
||||
if (!isTag(el, 'input')) {
|
||||
el = parentTag(el, 'label');
|
||||
el = el && qs('input', el);
|
||||
}
|
||||
let el = parentTag(event.target, 'button');
|
||||
if (el) {
|
||||
const name = el.name;
|
||||
if (/^add\[/.test(name)) {
|
||||
@@ -264,18 +260,24 @@ function editingClick(event) {
|
||||
editingMoveRow.call(el);
|
||||
} else if (/^drop_col\[/.test(name)) {
|
||||
editingRemoveRow.call(el, 'fields$1[field]');
|
||||
} else {
|
||||
if (name == 'auto_increment_col') {
|
||||
const field = el.form['fields[' + el.value + '][field]'];
|
||||
if (!field.value) {
|
||||
field.value = 'id';
|
||||
field.oninput();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
el = event.target;
|
||||
if (!isTag(el, 'input')) {
|
||||
el = parentTag(el, 'label');
|
||||
el = el && qs('input', el);
|
||||
}
|
||||
if (el) {
|
||||
const name = el.name;
|
||||
if (name == 'auto_increment_col') {
|
||||
const field = el.form['fields[' + el.value + '][field]'];
|
||||
if (!field.value) {
|
||||
field.value = 'id';
|
||||
field.oninput();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Handle input on fields editing
|
||||
@@ -334,11 +336,11 @@ function editingAddRow(focus) {
|
||||
const x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1';
|
||||
const row = parentTag(this, 'tr');
|
||||
const row2 = cloneNode(row);
|
||||
let tags = qsa('select', row);
|
||||
let tags2 = qsa('select', row2);
|
||||
let tags = qsa('select, input, button', row);
|
||||
let tags2 = qsa('select, input, button', row2);
|
||||
for (let i=0; i < tags.length; i++) {
|
||||
tags2[i].name = tags[i].name.replace(/[0-9.]+/, x);
|
||||
tags2[i].selectedIndex = tags[i].selectedIndex;
|
||||
tags2[i].selectedIndex = (/\[(generated)/.test(tags[i].name) ? 0 : tags[i].selectedIndex);
|
||||
}
|
||||
tags = qsa('input', row);
|
||||
tags2 = qsa('input', row2);
|
||||
@@ -348,13 +350,11 @@ function editingAddRow(focus) {
|
||||
tags2[i].value = x;
|
||||
tags2[i].checked = false;
|
||||
}
|
||||
tags2[i].name = tags[i].name.replace(/([0-9.]+)/, x);
|
||||
if (/\[(orig|field|comment|default)/.test(tags[i].name)) {
|
||||
tags2[i].value = '';
|
||||
}
|
||||
if (/\[(generated)/.test(tags[i].name)) {
|
||||
tags2[i].checked = false;
|
||||
tags2[i].selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
tags[0].oninput = editingNameChange;
|
||||
|
Reference in New Issue
Block a user