Sha256: 5e8c9875c21681ac95f67c21ebe2ff59c2e2c514bd8548ce24cffb4b87b6bf5b
Contents?: true
Size: 860 Bytes
Versions: 22
Compression:
Stored size: 860 Bytes
Contents
class Teaspoon.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("teaspoon-#{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
22 entries across 22 versions & 1 rubygems