wangEditor icon indicating copy to clipboard operation
wangEditor copied to clipboard

Right-click to display hover menu - 右鍵單擊以顯示懸停選單

Open shakhrillodev opened this issue 1 year ago • 7 comments

EN: I don't speak Chinese. So the Google Translate software I currently use may have some flaws. So I want to show the hover bar whenever the user clicks on the right side of the mouse device. I read the documentation but can't find a solution to my problem. CN: 我不會說中文。所以我目前使用的Google翻譯軟體可能會有一些缺陷。因此,我想每當用戶單擊滑鼠設備的右側時顯示懸停欄。我閱讀了文檔,但找不到解決我的問題的方法。

shakhrillodev avatar Sep 06 '24 13:09 shakhrillodev

Also it would have been better if someone helps me to figure out how to manually open the image explorer in the editor so that I could open it manually when user clicks some button outside of the editor.

shakhrillodev avatar Sep 08 '24 10:09 shakhrillodev

do you mean something like this? image

if you want click the side hover bar and insert node,that need dev a new side bar. There is currently no such option within wangeditor. I think that is important,if you want do it,you can dev in wangeditor-next

cycleccc avatar Sep 09 '24 02:09 cycleccc

Also it would have been better if someone helps me to figure out how to manually open the image explorer in the editor so that I could open it manually when user clicks some button outside of the editor.

If you want to open the image explorer, you can open the Upload Image menu with a hotkey. And if you're going to set a hotkey, you need to reconstruct this menu

cycleccc avatar Sep 09 '24 02:09 cycleccc

This site (https://huixie.iflyrec.com/list) was developed using WangEditor to create a sidebar. You can try cloning it.

cycleccc avatar Sep 09 '24 02:09 cycleccc

do you mean something like this? image

if you want click the side hover bar and insert node,that need dev a new side bar. There is currently no such option within wangeditor. I think that is important,if you want do it,you can dev in wangeditor-next

I had to make a component to create tests and the options also had to allow user to upload image and have the functionality of the text editor. I wanted to make a custom context menu which would have been displayed whenever user clicked right side of his mouse (whom's default behaviour is displaying browsers inbuilt context menu). I ended up making something like this by placing the toolbar on the right side and attaching custom made button after registering it to the wang editor Boot. image But there is still a problem. image The button's are getting disable whenever editor loses focus and I do not want that.

shakhrillodev avatar Sep 10 '24 10:09 shakhrillodev

It can be controlled by modifying the isDisabled method. It can also be clicked without selection. like that https://github.com/cycleccc/wangEditor-next/blob/139268eac7ea2f9444d99263f08e8525b9fc5cf0/packages/basic-modules/src/modules/divider/menu/InsertDividerMenu.ts#L25

cycleccc avatar Sep 12 '24 02:09 cycleccc

It can be controlled by modifying the isDisabled method. It can also be clicked without selection. like that https://github.com/cycleccc/wangEditor-next/blob/139268eac7ea2f9444d99263f08e8525b9fc5cf0/packages/basic-modules/src/modules/divider/menu/InsertDividerMenu.ts#L25

Oh never mind. I was not aware that the alwaysEnable option was already available in the IButtonInterface: https://github.com/wangeditor-team/wangEditor/blob/master/packages/core/src/menus/interface.ts#L35

shakhrillodev avatar Sep 16 '24 09:09 shakhrillodev