mirror of
https://github.com/simonw/datasette.git
synced 2026-07-08 16:44:34 +02:00
Switching to create table from data tab no longer marks as dirty
I was getting a confirm() dialog when I clicked outside the dialog on the create table from data page despite not having filled out any fields.
This commit is contained in:
parent
7ae601588e
commit
cb622a3dd6
1 changed files with 3 additions and 8 deletions
|
|
@ -855,17 +855,12 @@ function tableCreateDialogSignature(state) {
|
|||
return "";
|
||||
}
|
||||
var signature = {
|
||||
mode: state.mode || "manual",
|
||||
table: state.tableName.value,
|
||||
data: state.dataTextarea ? state.dataTextarea.value : "",
|
||||
dataPrimaryKey: state.dataPkSelect
|
||||
? state.dataPkSelect.value
|
||||
: TABLE_CREATE_AUTOMATIC_PK,
|
||||
};
|
||||
if (tableCreateIsDataMode(state)) {
|
||||
signature.previewReady = !!state.dataPreviewReady;
|
||||
} else {
|
||||
signature.columns = tableCreateDialogRows(state).map(function (row) {
|
||||
columns: tableCreateDialogRows(state).map(function (row) {
|
||||
return {
|
||||
name: row.querySelector(".table-create-column-name").value,
|
||||
type: row.querySelector(".table-create-column-type").value,
|
||||
|
|
@ -886,8 +881,8 @@ function tableCreateDialogSignature(state) {
|
|||
}
|
||||
).value || "",
|
||||
};
|
||||
});
|
||||
}
|
||||
}),
|
||||
};
|
||||
return JSON.stringify(signature);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue