如何实现TinyMCE表格拖动手柄?
在tinyMCE中,您可以使用表格插件来插入表格,这很好。现在,当涉及到在内容中移动表格时,就有点棘手了。
目前正确的做法是“选择整个表格”并“将其拖动到您想要的位置”。
这有点笨拙,现实生活中的用户很可能会在选择中错过表格的一部分,而拖动这个公正的选择将完全破坏表格。
此问题的正确解决方案可能是在桌子顶部实现一种“手柄”,或者用户可以抓住/拖/放以一次安全地移动整个桌子。
知道如何实现这么好的事情吗?
In tinyMCE you can use the table plugin to insert tables, and that is fine. Now when it comes to moving the table around in your content, it's a bit more tricky.
The correct way of doing it at the moment is to 'select the whole table' and 'drag it to where you want'.
This is a bit clunky and real-life users are most likely to miss a bit of their table in the selection, and dragging this impartial selection will completely break the table.
The correct solution to this problem is probably to implement a kind of 'handle' on top of the table or something that users could grab/drag/drop to securely move the whole table at once.
Any idea of how to implement such a nice thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该将此功能放在自己的插件中,如果拖动手势事件被触发,您将检查用户抓取了什么。如果他的选择包含表格的一部分,您可以将拖动内容替换为完整表格。
You should put this functionality in an own plugin and if the draggesture event gets fired you check what the user has grabed. If his selection contains a part of the table you replace the drag content with the full table.