module View.Click ( clickTo ) where import Signal import Json.Decode as Json import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) import TransitRouter import Route exposing (Route, toPath) clickTo : Route -> List Attribute clickTo route = let path = toPath route in [ href path , onWithOptions "click" { stopPropagation = True, preventDefault = True } Json.value (\_ -> Signal.message TransitRouter.pushPathAddress path) ]