浏览代码

:recycle: https://github.com/siyuan-note/siyuan/issues/9560

Vanessa 1 年之前
父节点
当前提交
1b5fba3d73

+ 8 - 4
app/src/assets/scss/business/_av.scss

@@ -4,7 +4,7 @@
 
 
   &__pulse {
   &__pulse {
     width: 70%;
     width: 70%;
-    height: 26px;
+    height: 23px;
     position: relative;
     position: relative;
     overflow: hidden;
     overflow: hidden;
     background: var(--b3-border-color);
     background: var(--b3-border-color);
@@ -61,10 +61,14 @@
   &__gutters {
   &__gutters {
     @extend .protyle-gutters;
     @extend .protyle-gutters;
     position: absolute;
     position: absolute;
-    top: 5px;
-    left: -26px;
+    top: 0;
+    left: -44px;
     opacity: 0;
     opacity: 0;
-    padding-right: 4px;
+    display: flex;
+
+    svg {
+      height: 25px;
+    }
   }
   }
 
 
   &__mask {
   &__mask {

+ 0 - 4
app/src/block/popover.ts

@@ -21,10 +21,6 @@ export const initBlockPopover = (app: App) => {
             hasClosestByAttribute(event.target, "data-type", "inline-memo");
             hasClosestByAttribute(event.target, "data-type", "inline-memo");
         if (aElement) {
         if (aElement) {
             let tip = aElement.getAttribute("aria-label") || aElement.getAttribute("data-inline-memo-content");
             let tip = aElement.getAttribute("aria-label") || aElement.getAttribute("data-inline-memo-content");
-            // 折叠块标文案替换
-            if (hasClosestByAttribute(event.target, "data-type", "fold", true)) {
-                tip = window.siyuan.languages.fold;
-            }
             if (aElement.classList.contains("av__celltext")) {
             if (aElement.classList.contains("av__celltext")) {
                 if (aElement.scrollWidth > aElement.parentElement.clientWidth - 11) {
                 if (aElement.scrollWidth > aElement.parentElement.clientWidth - 11) {
                     if (aElement.querySelector(".av__cellicon")) {
                     if (aElement.querySelector(".av__cellicon")) {

+ 4 - 9
app/src/protyle/gutter/index.ts

@@ -46,13 +46,6 @@ export class Gutter {
     constructor(protyle: IProtyle) {
     constructor(protyle: IProtyle) {
         this.element = document.createElement("div");
         this.element = document.createElement("div");
         this.element.className = "protyle-gutters";
         this.element.className = "protyle-gutters";
-        if (/Mac/.test(navigator.platform) || navigator.platform === "iPhone") {
-            this.element.setAttribute("aria-label", window.siyuan.languages.gutterTip);
-        } else {
-            this.element.setAttribute("aria-label", window.siyuan.languages.gutterTip.replace("⌥⌘A", "Ctrl+Alt+A").replace(/⌘/g, "Ctrl+").replace(/⌥/g, "Alt+").replace(/⇧/g, "Shift+").replace(/⌃/g, "Ctrl+"));
-        }
-        this.element.setAttribute("data-type", "a");
-        this.element.setAttribute("data-position", "right");
         this.element.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
         this.element.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
             hideTooltip();
             hideTooltip();
             const buttonElement = event.target.parentElement;
             const buttonElement = event.target.parentElement;
@@ -1843,7 +1836,8 @@ export class Gutter {
                     html = "";
                     html = "";
                 }
                 }
                 index += 1;
                 index += 1;
-                const buttonHTML = `<button data-type="${type}" data-subtype="${nodeElement.getAttribute("data-subtype")}" data-node-id="${nodeElement.getAttribute("data-node-id")}">
+                const buttonHTML = `<button class="ariaLabel" data-position="right" aria-label="${window.siyuan.languages.gutterTip}" 
+data-type="${type}" data-subtype="${nodeElement.getAttribute("data-subtype")}" data-node-id="${nodeElement.getAttribute("data-node-id")}">
     <svg><use xlink:href="#${getIconByType(type, nodeElement.getAttribute("data-subtype"))}"></use></svg>
     <svg><use xlink:href="#${getIconByType(type, nodeElement.getAttribute("data-subtype"))}"></use></svg>
     <span ${protyle.disabled ? "" : 'draggable="true"'}></span>
     <span ${protyle.disabled ? "" : 'draggable="true"'}></span>
 </button>`;
 </button>`;
@@ -1853,7 +1847,8 @@ export class Gutter {
                 let foldHTML = "";
                 let foldHTML = "";
                 if (type === "NodeListItem" && nodeElement.childElementCount > 3 || type === "NodeHeading") {
                 if (type === "NodeListItem" && nodeElement.childElementCount > 3 || type === "NodeHeading") {
                     const fold = nodeElement.getAttribute("fold");
                     const fold = nodeElement.getAttribute("fold");
-                    foldHTML = `<button data-type="fold"><svg style="width:10px${fold && fold === "1" ? "" : ";transform:rotate(90deg)"}"><use xlink:href="#iconPlay"></use></svg></button>`;
+                    foldHTML = `<button class="ariaLabel" data-position="right" aria-label="${window.siyuan.languages.fold}" 
+data-type="fold"><svg style="width:10px${fold && fold === "1" ? "" : ";transform:rotate(90deg)"}"><use xlink:href="#iconPlay"></use></svg></button>`;
                 }
                 }
                 if (type === "NodeListItem" || type === "NodeList") {
                 if (type === "NodeListItem" || type === "NodeList") {
                     listItem = nodeElement;
                     listItem = nodeElement;

+ 3 - 2
app/src/protyle/render/av/render.ts

@@ -79,8 +79,9 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use x
                 // body
                 // body
                 data.rows.forEach((row: IAVRow) => {
                 data.rows.forEach((row: IAVRow) => {
                     tableHTML += `<div class="av__row" data-id="${row.id}">
                     tableHTML += `<div class="av__row" data-id="${row.id}">
-<div class="av__gutters ariaLabel" draggable="true" data-position="right" aria-label="${window.siyuan.languages.rowTip}">
-    <button><svg><use xlink:href="#iconDrag"></use></svg></button>
+<div class="av__gutters">
+    <button class="ariaLabel" data-position="right" aria-label="${window.siyuan.languages.d}"><svg><use xlink:href="#iconAdd"></use></svg></button>
+    <button class="ariaLabel" draggable="true" data-position="right" aria-label="${window.siyuan.languages.rowTip}"><svg><use xlink:href="#iconDrag"></use></svg></button>
 </div>
 </div>
 <div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;
 <div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;
                     row.cells.forEach((cell, index) => {
                     row.cells.forEach((cell, index) => {