Skip to content

Commit 3591d9d

Browse files
committed
template and css cleanup
1 parent aaab7d3 commit 3591d9d

2 files changed

Lines changed: 59 additions & 54 deletions

File tree

src/main/js/bundles/dn_labeling/LabelingWidget.vue

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
1717
-->
1818
<template>
19-
<div class="labelingWidgetContainer">
20-
<div class="__selections-div">
21-
<div>
22-
<h4>{{ i18n.selectionTitle }}</h4>
19+
<div class="ct-labeling-widget">
20+
<div class="ct-labeling-widget__selections">
21+
<v-sheet class="mb-1">
22+
<h3>{{ i18n.selectionTitle }}</h3>
2323
<v-autocomplete
2424
v-model="selectedLayer"
2525
:items="layers"
@@ -31,31 +31,32 @@
3131
hide-details
3232
class="pt-0 mt-0 pb-2"
3333
/>
34-
</div>
35-
<div>
36-
<div v-show="edit">
37-
<v-sheet elevation="12">
38-
<v-btn
39-
id="iconRight"
40-
icon
41-
small
42-
@click="edit = !edit"
43-
>
44-
<v-icon>close</v-icon>
45-
</v-btn>
46-
<div id="editText">
47-
<v-text-field
48-
v-model="editedField.prefix"
49-
:label="i18n.prefix"
50-
/>
51-
<v-text-field
52-
v-model="editedField.postfix"
53-
:label="i18n.postfix"
54-
/>
55-
</div>
56-
</v-sheet>
34+
</v-sheet>
35+
<v-sheet
36+
v-show="edit"
37+
class="my-1"
38+
>
39+
<v-btn
40+
id="iconRight"
41+
icon
42+
small
43+
@click="edit = !edit"
44+
>
45+
<v-icon>close</v-icon>
46+
</v-btn>
47+
<div id="editText">
48+
<v-text-field
49+
v-model="editedField.prefix"
50+
:label="i18n.prefix"
51+
/>
52+
<v-text-field
53+
v-model="editedField.postfix"
54+
:label="i18n.postfix"
55+
/>
5756
</div>
58-
<h4>{{ i18n.selectionFields }}</h4>
57+
</v-sheet>
58+
<v-sheet class="my-1">
59+
<h3>{{ i18n.selectionFields }}</h3>
5960
<v-select
6061
id="autocomplete"
6162
v-model="selectedFields"
@@ -72,7 +73,7 @@
7273
>
7374
<template #selection="data">
7475
<draggable
75-
:id="data.index"
76+
:id="`ct-labeling-attribute-${data.index}`"
7677
:list="selectedFields"
7778
v-bind="dragOptionsChips"
7879
:move="move"
@@ -108,10 +109,11 @@
108109
</draggable>
109110
</template>
110111
</v-select>
111-
</div>
112+
</v-sheet>
112113
</div>
113-
<div class="__controls-div">
114-
<div>
114+
<v-divider />
115+
<div class="ct-labeling-widget__controls-div">
116+
<div class="my-1">
115117
<v-switch
116118
v-model="showFeatureEdgeLengths"
117119
class="controls circumference-switch"

src/main/js/bundles/dn_labeling/css/styles.css

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
.ctAppRoot .labelingWidget .labelingWidgetContainer {
16+
.ctAppRoot .ct-labeling-widget {
1717
display: flex;
1818
flex-direction: column;
1919
height: 100%;
2020

21-
.__selections-div {
21+
.ct-labeling-widget__selections {
2222
display: flex;
2323
flex-direction: column;
2424
flex-grow: 1;
@@ -34,12 +34,13 @@
3434
.v-chip__content{
3535
width: 100%;
3636
padding: 0;
37+
cursor: pointer;
3738
}
3839
}
3940
}
4041
}
4142

42-
.__controls-div {
43+
.ct-labeling-widget__controls-div {
4344
display: flex;
4445
flex-direction: column;
4546
flex-shrink: 1;
@@ -53,30 +54,32 @@
5354
margin-left: 0;
5455
}
5556
}
56-
}
5757

58-
.ctAppRoot .labelingWidget .v-btn--icon{
59-
margin: 0;
60-
}
58+
.v-btn--icon{
59+
margin: 0;
60+
}
6161

62-
.ctAppRoot .labelingWidget #editText{
63-
padding: 5px;
64-
margin: 10px;
65-
}
62+
/* TODO: remove usages of ID slectors */
63+
#editText{
64+
padding: 5px;
65+
margin: 10px;
66+
}
6667

67-
.ctAppRoot .labelingWidget #iconRight{
68-
float: right;
69-
}
68+
#iconRight{
69+
float: right;
70+
}
7071

71-
.ctAppRoot .labelingWidget #autocomplete {
72-
display: none;
73-
}
72+
#autocomplete {
73+
display: none;
74+
}
7475

75-
.ctAppRoot .labelingWidget .draggableSelect.v-input--is-dirty .v-input__slot:before {
76-
display: none;
77-
}
76+
.draggableSelect.v-input--is-dirty .v-input__slot:before {
77+
display: none;
78+
}
7879

79-
.ctAppRoot .labelingWidget .labelingWidgetContainer .__selections-div .v-select__selections .v-chip span {
80-
color: #45474d;
80+
.ct-labeling-widget__selections .v-select__selections .v-chip span {
81+
color: #45474d;
82+
}
8183
}
8284

85+

0 commit comments

Comments
 (0)