UNPKG

kdf

Version:

KD: a non-document focused UI Framework for web applications.

24 lines (14 loc) 529 B
KDView = require './view.coffee' module.exports = class KDCustomHTMLView extends KDView constructor:(options = {}, data)-> @tagName = options if typeof options is 'string' @tagName ?= options.tagName ? 'div' if @tagName is 'a' and not options.attributes?.href? options.attributes or= {} options.attributes.href = '#' super options, data setDomElement:(cssClass)-> super @unsetClass 'kdview' el = @getElement() el.removeAttribute 'class' unless el.classList.length