Skip to content

Commit

Permalink
fix mobile side bar doesn't hide correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkmm committed Dec 30, 2023
1 parent 2df36d1 commit e293122
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ now can remove almost all the buttons
## 0.1.5 2023.12.17
- add more buttons

## 1.0.0 2023.12.23
- refactor entire plugin, support more listening implementation
## 1.0.0 2023.12.23
- refactor entire plugin, support more listening implementation

## 1.0.1 2023.12.23
- fix mobile side bar doesn't hide correctly
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "siyuan_rmv_btn",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"description": "A plugin to remove menu items you don't really need.",
"repository": "https://github.com/zxkmm/siyuan_rmv_btn",
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan_rmv_btn",
"author": "zxkmm",
"url": "https://github.com/zxkmm/siyuan_rmv_btn",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "2.10.14",
"backends": [
"windows",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/en_US.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"totalSwitch": "Total Switch",
"totalSwitchdesc": "If the items you want to hide are related to the commercial part of Source, please consider donating to @D and @V (not me) as they live by writing open-source code.<br> v1.0.0",
"totalSwitchdesc": "If the items you want to hide are related to the commercial part of Source, please consider donating to @D and @V (not me) as they live by writing open-source code.<br> v1.0.1",
"listenImplementation": "Listen Implementation",
"listenImplementationdesc": "It is recommended to choose the DOMNodeInserted option for the best overall performance, but this option will output a warning in the terminal. If you cannot accept this, please choose one of the other two implementations.",
"reload_hint": "Reload the interface to apply the latest changes.",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/zh_CN.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"totalSwitch":"总开关",
"totalSwitchdesc":"如果您要隐藏的项目与思源的商业部分有关,请考虑向@D和@V捐赠(不是我),因为他们以编写开源代码生活。<br> v1.0.0",
"totalSwitchdesc":"如果您要隐藏的项目与思源的商业部分有关,请考虑向@D和@V捐赠(不是我),因为他们以编写开源代码生活。<br> v1.0.1",
"listenImplementation": "监听实现",
"listenImplementationdesc":"建议首选综合性能最佳的DOMNodeInserted, 但是这个选项会在终端输出一个warning,如果您无法接受,请选择另外两个实现",
"reload_hint":"重载界面以应用最新更改",
Expand Down
15 changes: 15 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default class siyuan_rmv_btn extends Plugin {
}

rmvSideBarIcons(_toRemoveListArray_){
//pc view
_toRemoveListArray_.forEach(elementType => {
const styleElement = document.createElement('style');
styleElement.textContent = `
Expand All @@ -119,6 +120,20 @@ export default class siyuan_rmv_btn extends Plugin {
`;
document.head.appendChild(styleElement);
});
//mobile view


//mobile
_toRemoveListArray_.forEach(elementType => {
const styleElement = document.createElement('style');
styleElement.textContent = `
.toolbar__icon[data-type="sidebar-${elementType}-tab"] {
display: none;
}
`;

document.head.appendChild(styleElement);
});
}

checkOldComfigExist(){ //old trash detect
Expand Down

0 comments on commit e293122

Please sign in to comment.