channels = [channels];\r
}\r
_.each(channels, function (chan) {\r
- var frag, row, name, chanlink, num_users, topic;\r
- frag = document.createDocumentFragment();\r
+ var row;\r
row = document.createElement("tr");\r
- name = document.createElement("td");\r
- chanlink = document.createElement("a");\r
- if (typeof chanlink.dataset !== "undefined") {\r
- chanlink.dataset.channel = chan.channel;\r
- } else {\r
- chanlink.setAttribute('data-channel', chan.channel);\r
- }\r
- chanlink.textContent = _.escape(chan.channel);\r
- chanlink.classList.add('chan');\r
- name.appendChild(chanlink);\r
- row.appendChild(name);\r
- num_users = document.createElement("td");\r
- num_users.textContent = chan.num_users;\r
- num_users.classList.add("num_users");\r
- num_users.style.textAlign = 'center';\r
- row.appendChild(num_users);\r
- topic = document.createElement("td");\r
- topic.style.paddingLeft = '2em';\r
- topic.innerHTML = formatIRCMsg(_.escape(chan.topic));\r
- row.appendChild(topic);\r
- frag.appendChild(row);\r
-\r
- chan.dom = frag;\r
+ row.innerHTML = '<td><a class="chan" data-channel="' + chan.channel + '">' + _.escape(chan.channel) + '</a></td><td class="num_users" style="text-align: center;">' + chan.num_users + '</td><td style="padding-left: 2em;">' + formatIRCMsg(_.escape(chan.topic)) + '</td>';\r
+ chan.dom = row;\r
that.view.channels.push(chan);\r
});\r
\r