Sfoglia il codice sorgente

cdb: add css classes based on names

trethaller 4 anni fa
parent
commit
520df89562
2 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 1 0
      hide/comp/cdb/Cell.hx
  2. 2 0
      hide/comp/cdb/Table.hx

+ 1 - 0
hide/comp/cdb/Cell.hx

@@ -20,6 +20,7 @@ class Cell extends Component {
 		this.column = column;
 		@:privateAccess line.cells.push(this);
 		root.addClass("t_" + typeNames[column.type.getIndex()]);
+		root.addClass("n_" + column.name);
 		if( column.kind == Script ) root.addClass("t_script");
 		refresh();
 		switch( column.type ) {

+ 2 - 0
hide/comp/cdb/Table.hx

@@ -31,6 +31,7 @@ class Table extends Component {
 
 		@:privateAccess editor.tables.push(this);
 		root.addClass("cdb-sheet");
+		root.addClass("n_" + sheet.name);
 		if( editor.view != null ) {
 			var cname = parent == null ? null : sheet.parent.sheet.columns[sheet.parent.column].name;
 			if( parent == null )
@@ -140,6 +141,7 @@ class Table extends Component {
 			var col = J("<th>");
 			col.text(c.name);
 			col.addClass( "t_"+c.type.getName().substr(1).toLowerCase() );
+			col.addClass( "n_" + c.name );
 			if( c.documentation != null )
 				col.attr("title", c.documentation);
 			if( sheet.props.displayColumn == c.name )