Swap tabular rendering from using inline css to applying styles for row/header.

This commit is contained in:
Dannon Baker
2014-12-15 09:47:45 -05:00
parent 6ceed69ce9
commit a1ebbe4528
5 changed files with 15 additions and 13 deletions
+2 -6
View File
@@ -128,10 +128,6 @@ var TabularDatasetChunkedView = Backbone.View.extend({
this.row_count = 0;
this.loading_chunk = false;
// CSS colors used in table.
this.header_color = '#AAA';
this.dark_row_color = '#DDD';
// load trackster button
new TabularButtonTracksterView({
model : options.model,
@@ -173,7 +169,7 @@ var TabularDatasetChunkedView = Backbone.View.extend({
});
this.$el.append(data_table);
var column_names = this.model.get_metadata('column_names'),
header_row = $('<tr/>').css('background-color', this.header_color).appendTo(data_table);
header_row = $('<tr/>').appendTo(data_table);
if (column_names) {
header_row.append('<th>' + column_names.join('</th><th>') + '</th>');
} else {
@@ -236,7 +232,7 @@ var TabularDatasetChunkedView = Backbone.View.extend({
num_columns = this.model.get_metadata('columns');
if (this.row_count % 2 !== 0) {
row.css('background-color', this.dark_row_color);
row.addClass('dark_row');
}
if (cells.length === num_columns) {
+2 -6
View File
@@ -128,10 +128,6 @@ var TabularDatasetChunkedView = Backbone.View.extend({
this.row_count = 0;
this.loading_chunk = false;
// CSS colors used in table.
this.header_color = '#AAA';
this.dark_row_color = '#DDD';
// load trackster button
new TabularButtonTracksterView({
model : options.model,
@@ -173,7 +169,7 @@ var TabularDatasetChunkedView = Backbone.View.extend({
});
this.$el.append(data_table);
var column_names = this.model.get_metadata('column_names'),
header_row = $('<tr/>').css('background-color', this.header_color).appendTo(data_table);
header_row = $('<tr/>').appendTo(data_table);
if (column_names) {
header_row.append('<th>' + column_names.join('</th><th>') + '</th>');
} else {
@@ -236,7 +232,7 @@ var TabularDatasetChunkedView = Backbone.View.extend({
num_columns = this.model.get_metadata('columns');
if (this.row_count % 2 !== 0) {
row.css('background-color', this.dark_row_color);
row.addClass('dark_row');
}
if (cells.length === num_columns) {
File diff suppressed because one or more lines are too long
+2
View File
@@ -2234,6 +2234,8 @@ div.toolTitleNoSection{padding-bottom:5px;font-weight:bold}
#loading_indicator{position:fixed;right:10px;top:10px;height:32px;width:32px;display:none;background:url(largespinner.gif)}
#content_table td{text-align:right;white-space:nowrap;padding:2px 10px}
#content_table td.stringalign{text-align:left}
#content_table .dark_row{background-color:#DDD}
#content_table th{background-color:#AAA}
.toolMenuAndView .toolForm{float:left;background-color:white;margin:10px}
.text-and-autocomplete-select{background:none;position:relative;padding-right:18px}.text-and-autocomplete-select:after{margin-top:6px;position:absolute;top:2px;right:6px;width:10px;height:10px;display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;border-bottom:0 dotted;content:"";filter:alpha(opacity=8000);opacity:80;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=8000);filter:alpha(opacity=8000)}.btn-default .text-and-autocomplete-select:after{border-top-color:#333}
.btn-primary .text-and-autocomplete-select:after,.btn-success .text-and-autocomplete-select:after,.btn-warning .text-and-autocomplete-select:after,.btn-danger .text-and-autocomplete-select:after,.btn-info .text-and-autocomplete-select:after{border-top-color:#fff}
+8
View File
@@ -1553,6 +1553,14 @@ div.toolTitleNoSection
text-align:left;
}
#content_table .dark_row{
background-color: #DDD;
}
#content_table th{
background-color: #AAA;
}
// ==== Integrated tool form styles
.toolMenuAndView .toolForm