Sha256: 54fa7b5ce834c61e976bf00f1e4e7fdafe66cbb5317b84a6007191bda43abd9c
Contents?: true
Size: 856 Bytes
Versions: 19
Compression:
Stored size: 856 Bytes
Contents
class Teabag.Reporters.BaseView constructor: -> @elements = {} @build() build: (className) -> @el = @createEl("li", className) appendTo: (el) -> el.appendChild(@el) append: (el) -> @el.appendChild(el) createEl: (type, className = "") -> el = document.createElement(type) el.className = className el findEl: (id) -> @elements ||= {} @elements[id] ||= document.getElementById("teabag-#{id}") setText: (id, value) -> el = @findEl(id) el.innerHTML = value setHtml: (id, value, add = false) -> el = @findEl(id) if add then el.innerHTML += value else el.innerHTML = value setClass: (id, value) -> el = @findEl(id) el.className = value htmlSafe: (str) -> el = document.createElement("div") el.appendChild(document.createTextNode(str)) el.innerHTML
Version data entries
19 entries across 19 versions & 1 rubygems