Browse Source

fixes style select2 edit

ncannasse 7 years ago
parent
commit
fc8970b0a7
5 changed files with 62 additions and 9 deletions
  1. 2 1
      bin/cdb.css
  2. 1 1
      bin/cdb.less
  3. 30 4
      bin/style.css
  4. 28 2
      bin/style.less
  5. 1 1
      hide/comp/cdb/Table.hx

+ 2 - 1
bin/cdb.css

@@ -41,7 +41,8 @@
   padding-right: 6px;
 }
 .cdb .cdb-sheet td.edit > input,
-.cdb .cdb-sheet td.edit textarea {
+.cdb .cdb-sheet td.edit textarea,
+.cdb .cdb-sheet td.edit select {
   width: 100%;
   padding: 0px 2px;
   border: none;

+ 1 - 1
bin/cdb.less

@@ -46,7 +46,7 @@
 		td.edit {
 			padding : 2px;
 			padding-right : 6px;
-			&> input, textarea {
+			&> input, textarea, select {
 				width : 100%;
 				padding : 0px 2px;
 				border : none;

+ 30 - 4
bin/style.css

@@ -20,7 +20,8 @@ p,
 a,
 input,
 select,
-textarea {
+textarea,
+body .select2-dropdown {
   font-family: Verdana, serif;
   font-size: 9pt;
   color: #aaa;
@@ -37,20 +38,45 @@ select:focus:hover {
 }
 select,
 input,
-textarea {
+textarea,
+body .select2-dropdown {
   background-color: #222222;
   border: 1px solid #444;
 }
 select:focus,
 input:focus,
-textarea:focus {
+textarea:focus,
+body .select2-dropdown:focus {
   background-color: #141414;
 }
 select:hover,
 input:hover,
-textarea:hover {
+textarea:hover,
+body .select2-dropdown:hover {
   border-color: #888;
 }
+body .select2-container--default .select2-selection--single {
+  background-color: #222222;
+  border: none;
+  height: auto;
+}
+body .select2-container--default .select2-selection--single .select2-selection__rendered {
+  padding-left: 2px;
+  color: #aaa;
+}
+body .select2-container--default .select2-results__option[aria-selected=true] {
+  background-color: #444;
+}
+body .select2-container--default .select2-results__option--highlighted[aria-selected] {
+  background-color: #5897fb;
+}
+.select2-results__option > div {
+  display: flex;
+  align-items: center;
+}
+.select2-results__option > div div.tile {
+  margin-right: 5px;
+}
 input.file {
   cursor: pointer;
 }

+ 28 - 2
bin/style.less

@@ -16,7 +16,7 @@ ul, li {
 	list-style : none;
 }
 
-body, td, th, li, p, a, input, select, textarea {
+body, td, th, li, p, a, input, select, textarea, body .select2-dropdown {
 	font-family : Verdana, serif;
 	font-size : 9pt;
 	color: #aaa;
@@ -35,7 +35,7 @@ select {
 	}
 }
 
-select, input, textarea {
+select, input, textarea, body .select2-dropdown {
 	background-color: rgb(34,34,34);
 	border : 1px solid #444;
 	&:focus {
@@ -46,6 +46,32 @@ select, input, textarea {
 	}
 }
 
+body .select2-container--default {
+	.select2-selection--single {
+		background-color: rgb(34,34,34);
+		border : none;
+		height: auto;
+		.select2-selection__rendered {
+			padding-left: 2px;
+			color: #aaa;
+		}
+	}
+	.select2-results__option[aria-selected=true] {
+		background-color: #444;
+	}
+	.select2-results__option--highlighted[aria-selected] {
+		background-color: #5897fb;
+	}
+}
+
+.select2-results__option > div {
+	display : flex;
+	align-items: center;
+	div.tile {
+		margin-right : 5px;
+	}
+}
+
 input.file {
 	cursor : pointer;
 	&.dragover {

+ 1 - 1
hide/comp/cdb/Table.hx

@@ -242,7 +242,7 @@ class Table extends Component {
 		}
 		var sub = new SubTable(editor, cell);
 		sub.show();
-		editor.cursor.set(sub);
+		if( sub.lines.length > 0 ) editor.cursor.set(sub);
 	}
 
 }