有没有一种方法可以禁用短划线拖放功能? [英] Is there a way to disable drag&drop in dashing?

查看:91
本文介绍了有没有一种方法可以禁用短划线拖放功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图深入了解JS,但它超出了我的理解。 IMO有许多仪表板,没有必要重新安排内容。

Tried to dig through the JS, but it's above my head. IMO with many dashboards it does not make sense to rearrange things.

推荐答案

您可以通过添加 assets / javascripts / application.coffee 文件中的> items 参数并将其设置为 none,如下所示:

You can disable dragging by adding an items parameter in your assets/javascripts/application.coffee file and setting it to 'none' like so:

draggable:
    stop: Dashing.showGridsterInstructions
    start: -> Dashing.currentWidgetPositions = Dashing.getWidgetPositions()
    items: "none"

The items 参数采用与CSS选择器匹配的字符串。它还可以采用HTML元素的集合。只有匹配的元素是可拖动的。您可以传递任何字符串,只要它与您的任何小部件都不匹配即可。在这种情况下,没有元素匹配,这意味着拖动没有启用。

The items parameter takes a string that matches a CSS selector. It can also take a collection of HTML elements. Only matching elements will be draggable. You can pass any string, as long as it doesn't match any of your widgets. In this case, no elements are matching, which means that drag isn't enabled for anything.

这篇关于有没有一种方法可以禁用短划线拖放功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆