mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-22 23:14:07 +01:00
This commit is contained in:
parent
bc5b2b2291
commit
87203b1364
4 changed files with 35 additions and 24 deletions
|
|
@ -12,6 +12,9 @@ import {getContenteditableElement, getLastBlock} from "../wysiwyg/getBlock";
|
|||
import {genEmptyElement} from "../../block/util";
|
||||
import {transaction} from "../wysiwyg/transaction";
|
||||
import {focusByRange} from "../util/selection";
|
||||
/// #if !MOBILE
|
||||
import {moveResize} from "../../dialog/moveResize";
|
||||
/// #endif
|
||||
|
||||
export const initUI = (protyle: IProtyle) => {
|
||||
protyle.contentElement = document.createElement("div");
|
||||
|
|
@ -47,6 +50,16 @@ export const initUI = (protyle: IProtyle) => {
|
|||
|
||||
protyle.element.appendChild(protyle.toolbar.element);
|
||||
protyle.element.appendChild(protyle.toolbar.subElement);
|
||||
/// #if !MOBILE
|
||||
moveResize(protyle.toolbar.subElement, () => {
|
||||
const pinElement = protyle.toolbar.subElement.querySelector('.block__icons [data-type="pin"]');
|
||||
if (pinElement) {
|
||||
pinElement.querySelector("svg use").setAttribute("xlink:href", "#iconUnpin");
|
||||
pinElement.setAttribute("aria-label", window.siyuan.languages.unpin);
|
||||
protyle.toolbar.subElement.firstElementChild.setAttribute("data-drag", "true");
|
||||
}
|
||||
});
|
||||
/// #endif
|
||||
|
||||
protyle.element.append(protyle.highlight.styleElement);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue