Skip to content
This repository
Browse code

MINOR Shrinking GridField button column to fit, rather than hardcodin…

…g a width for it that depends on the amount and styling of buttons in the table
  • Loading branch information...
commit 3ef3a6df99ea554342e4e41e28b24543454b83f1 1 parent efc30fd
Ingo Schommer authored March 27, 2012
1  admin/css/ie7.css
@@ -20,6 +20,7 @@ html { overflow: hidden; }
20 20
 
21 21
 .jstree li a .ui-icon { text-indent: 0px !important; }
22 22
 
  23
+.cms table.ss-gridfield-table tbody td { width: auto; }
23 24
 .cms table.ss-gridfield-table tr th.extra span input { height: 23px; }
24 25
 
25 26
 .ss-gridfield-button-filter.ss-ui-button { margin: -1px -5px; background: #e6e6e6 url(../images/filter-icons.png) no-repeat -40px 6px; filter: none; }
14  admin/scss/ie7.scss
@@ -68,10 +68,16 @@ html {
68 68
 	text-indent: 0px !important;
69 69
 }
70 70
 
71  
-//fix for filter and reset icons on datagrid 
72  
-
73  
-.cms table.ss-gridfield-table tr th.extra span input {
74  
-	height:23px;
  71
+.cms table.ss-gridfield-table {
  72
+	tbody td {
  73
+		// Overrule width: 100% setting to trigger "shrink fit"
  74
+		// of button row, which IE7 doesn't support
  75
+		width: auto;
  76
+	}
  77
+	tr th.extra span input {
  78
+		//fix for filter and reset icons on datagrid 
  79
+		height:23px;
  80
+	}
75 81
 }
76 82
 
77 83
 .ss-gridfield-button-filter.ss-ui-button {
5  css/GridField.css
@@ -12,11 +12,12 @@
12 12
 .cms table.ss-gridfield-table thead { color: #1d2224; background: transparent; }
13 13
 .cms table.ss-gridfield-table thead tr.filter-header .fieldgroup { max-width: 512px; }
14 14
 .cms table.ss-gridfield-table tbody { background: #FFF; }
  15
+.cms table.ss-gridfield-table tbody td { width: 100%; }
  16
+.cms table.ss-gridfield-table tbody td.col-buttons { width: auto; text-align: right; white-space: nowrap; }
15 17
 .cms table.ss-gridfield-table tbody td button { border: none; background: none; margin: 0 0 0 2px; padding: 0; width: auto; text-shadow: none; }
16 18
 .cms table.ss-gridfield-table tbody td button.ui-state-hover { background: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
17 19
 .cms table.ss-gridfield-table tbody td button.ui-state-active { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
18  
-.cms table.ss-gridfield-table tbody td a.edit-link { display: inline-block; width: 16px; height: 20px; text-indent: -9999em; background: url(../images/icons/document--pencil.png) no-repeat 0 1px; }
19  
-.cms table.ss-gridfield-table tbody td.col-buttons { white-space: nowrap; }
  20
+.cms table.ss-gridfield-table tbody td a.edit-link { display: inline-block; width: 16px; height: 20px; text-indent: 9999em; background: url(../images/icons/document--pencil.png) no-repeat 0 1px; }
20 21
 .cms table.ss-gridfield-table tfoot { color: #1d2224; }
21 22
 .cms table.ss-gridfield-table tfoot tr td { background: #95a5ab; padding: .7em; border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
22 23
 .cms table.ss-gridfield-table tr.title { -moz-border-radius-topleft: 7px; -webkit-border-top-left-radius: 7px; -o-border-top-left-radius: 7px; -ms-border-top-left-radius: 7px; -khtml-border-top-left-radius: 7px; border-top-left-radius: 7px; -moz-border-radius-topright: 7px; -webkit-border-top-right-radius: 7px; -o-border-top-right-radius: 7px; -ms-border-top-right-radius: 7px; -khtml-border-top-right-radius: 7px; border-top-right-radius: 7px; }
16  scss/GridField.scss
@@ -98,6 +98,16 @@ $gf_grid_x:	16px;
98 98
 		tbody {
99 99
 			background: #FFF;
100 100
 			td {
  101
+				// Give browser some hints on which cols take priority:
  102
+				// The last column (buttons) should always shrink to fit.
  103
+				// Overwritten for IE7, which doesn't support this.
  104
+				width: 100%;
  105
+				&.col-buttons {
  106
+					width: auto;
  107
+					text-align: right;
  108
+					white-space: nowrap;
  109
+				}
  110
+
101 111
 				button {
102 112
 					border: none;
103 113
 					background: none;
@@ -118,13 +128,9 @@ $gf_grid_x:	16px;
118 128
 					display:inline-block;
119 129
 					width:$gf_grid_x;
120 130
 					height:20px; //min height to fit the edit icon
121  
-					text-indent:-9999em;
  131
+					text-indent:9999em;
122 132
 					background: url(../images/icons/document--pencil.png) no-repeat 0 1px;
123 133
 				}				
124  
-
125  
-				&.col-buttons {
126  
-					white-space: nowrap;
127  
-				}
128 134
 			}			
129 135
 		}
130 136
 

0 notes on commit 3ef3a6d

Please sign in to comment.
Something went wrong with that request. Please try again.