mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
a3e3a0aeed
commit
1d176d5a09
7 changed files with 45 additions and 33 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"removeCol": "Are you sure you want to delete the ${x} column in the database?",
|
||||||
"video": "Video",
|
"video": "Video",
|
||||||
"audio": "Audio",
|
"audio": "Audio",
|
||||||
"updateAll": "Update all",
|
"updateAll": "Update all",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"removeCol": "¿Está seguro de que desea eliminar la columna ${x} en la base de datos?",
|
||||||
"vídeo": "Vídeo",
|
"vídeo": "Vídeo",
|
||||||
"audio": "Audio",
|
"audio": "Audio",
|
||||||
"updateAll": "Actualizar todo",
|
"updateAll": "Actualizar todo",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"removeCol": "Êtes-vous sûr de vouloir supprimer la colonne ${x} de la base de données ?",
|
||||||
"video": "Vidéo",
|
"video": "Vidéo",
|
||||||
"audio": "Audio",
|
"audio": "Audio",
|
||||||
"updateAll": "Tout mettre à jour",
|
"updateAll": "Tout mettre à jour",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"removeCol": "確定刪除資料庫中的 ${x} 欄位?",
|
||||||
"video": "影片",
|
"video": "影片",
|
||||||
"audio": "音訊",
|
"audio": "音訊",
|
||||||
"updateAll": "全部更新",
|
"updateAll": "全部更新",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"removeCol": "确定删除数据库中的 ${x} 列?",
|
||||||
"video": "视频",
|
"video": "视频",
|
||||||
"audio": "音频",
|
"audio": "音频",
|
||||||
"updateAll": "全部更新",
|
"updateAll": "全部更新",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
import {isMobile} from "../util/functions";
|
import {isMobile} from "../util/functions";
|
||||||
import {Dialog} from "./index";
|
import {Dialog} from "./index";
|
||||||
|
|
||||||
export const confirmDialog = (title: string, text: string, confirm?: (dialog:Dialog) => void, cancel?: (dialog:Dialog) => void) => {
|
export const confirmDialog = (title: string, text: string, confirm?: (dialog?: Dialog) => void, cancel?: (dialog: Dialog) => void) => {
|
||||||
|
if (!text && !title) {
|
||||||
|
confirm();
|
||||||
|
return;
|
||||||
|
}
|
||||||
const dialog = new Dialog({
|
const dialog = new Dialog({
|
||||||
title,
|
title,
|
||||||
content: `<div class="b3-dialog__content">
|
content: `<div class="b3-dialog__content">
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import {bindRollupData, getRollupHTML, goSearchRollupCol} from "./rollup";
|
||||||
import {updateCellsValue} from "./cell";
|
import {updateCellsValue} from "./cell";
|
||||||
import {openCalcMenu} from "./calc";
|
import {openCalcMenu} from "./calc";
|
||||||
import * as dayjs from "dayjs";
|
import * as dayjs from "dayjs";
|
||||||
|
import {confirmDialog} from "../../../dialog/confirmDialog";
|
||||||
|
|
||||||
export const openMenuPanel = (options: {
|
export const openMenuPanel = (options: {
|
||||||
protyle: IProtyle,
|
protyle: IProtyle,
|
||||||
|
|
@ -1025,6 +1026,7 @@ export const openMenuPanel = (options: {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
} else if (type === "removeCol") {
|
} else if (type === "removeCol") {
|
||||||
|
confirmDialog(isCustomAttr ? window.siyuan.languages.deleteOpConfirm : "", isCustomAttr ? window.siyuan.languages.removeCol.replace("${x}", menuElement.querySelector("input").value) : "", () => {
|
||||||
const colId = menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id");
|
const colId = menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id");
|
||||||
let previousID: string;
|
let previousID: string;
|
||||||
const colData = data.view.columns.find((item: IAVColumn, index) => {
|
const colData = data.view.columns.find((item: IAVColumn, index) => {
|
||||||
|
|
@ -1057,6 +1059,7 @@ export const openMenuPanel = (options: {
|
||||||
removeAttrViewColAnimation(options.blockElement, colId);
|
removeAttrViewColAnimation(options.blockElement, colId);
|
||||||
options.blockElement.setAttribute("updated", newUpdated);
|
options.blockElement.setAttribute("updated", newUpdated);
|
||||||
avPanelElement.remove();
|
avPanelElement.remove();
|
||||||
|
})
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue