1

I am fiddling around with Dashing until I found that it only has one dashboard-level action. [link]

The Dashing project does not have the dashing.coffee file in the directory but it links to it. The reload action is contained here.

class window.Dashing extends Batman.App
  @on 'reload', (data) ->
    window.location.reload(true)

  @root ->
Dashing.params = Batman.URI.paramsFromQuery(window.location.search.slice(1));

I want to expand this file to add more actions. I tried creating a JS file dashing-cus.coffee on my local dashboard in an attempt to build more actions. However, my attempts results to either prototype errors or non-responding actions.

What is the best way to expand its actions? Let's say an 'alert' action to alert 'hello!'

4

1 回答 1

0

我不确定为什么以及您是否真的想重写Dashing课程。

但最好的方法是只使用dashing.coffee项目内部的副本作为./assets/javascript/dashing-cus.coffee并将该行替换为:

 #= require dashing-cus.coffee

dashing-cus.coffee你可以根据需要自定义,window.Dashing因为不再使用原始的 Dashing 脚本......

于 2015-02-11T16:01:59.270 回答