Skip to content

Commit

Permalink
Header images
Browse files Browse the repository at this point in the history
  • Loading branch information
Harri Virtanen committed Apr 22, 2016
1 parent f298d09 commit e471edf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/table_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ export default Ember.Object.extend({

cssClassesString: function() {
return this.cssClasses().join(' ');
},

icon: function() {
return this.depth === 1 && this.type === 'row' ? '<div class="row-highlight-icon"></div>' : null;
}
});
6 changes: 6 additions & 0 deletions views/table_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export default View.extend(Statechart, {
// We have to support <br> for row headers, so we'll replace them back after escaping
headerLabel = Ember.Handlebars.Utils.escapeExpression(headerLabel).replace(/&lt;br&gt;/g, '<br>');
buffer.attr('title', headerLabel.replace(/<br>/g, '\n'));
if (header.guid) buffer.attr('data-guid', header.guid);

if (header.rowspan > 1) {
buffer.attr('rowspan', header.rowspan);
Expand Down Expand Up @@ -530,10 +531,15 @@ export default View.extend(Statechart, {
cssClasses.push(i % 2 === 0 ? 'even-col' : 'odd-col');
cssClasses = cssClasses.concat(header.cssClasses());
if (clickable) cssClasses.push('clickable');
if (header.depth === 1) cssClasses.push('base-header');
buffer.attr('class', cssClasses.join(' '));

buffer.pushOpeningTag(); // td
buffer.push('<div class="content-container">');

var headerIcon = header.icon();
if (headerIcon) buffer.push(headerIcon);

buffer.push(resizeHandle);
buffer.push(label.fmt(headerLabel));
buffer.push('</div>');
Expand Down

0 comments on commit e471edf

Please sign in to comment.