coffeescript-ui
Version:
Coffeescript User Interface System
49 lines (38 loc) • 1.02 kB
text/coffeescript
###
* coffeescript-ui - Coffeescript User Interface System (CUI)
* Copyright (c) 2013 - 2016 Programmfabrik GmbH
* MIT Licence
* https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org
###
CUI.Template.loadTemplateText(require('./ButtonHref.html'));
CUI.Template.loadTemplateText(require('./ButtonHref_ng.html'));
class CUI.ButtonHref extends CUI.Button
constructor: (opts) ->
super(opts)
attr =
href:
tabindex: "0"
target:
if
attr.download = "download"
CUI.dom.setAttributeMap(, attr)
initOpts: ->
super()
href:
check: String
download:
check: Boolean
target:
check: String
readOpts: ->
super()
if == undefined and == "link"
= "external_link"
@
setHref: (href) ->
CUI.dom.setAttribute(, "href", href)
getTemplateName: ->
# super sets +
super()
return if CUI.__ng__ then "buttonHref-ng" else "buttonHref"