Skip to content

Commit da84b2e

Browse files
committed
[feature] add group order controls
1 parent 0a27c87 commit da84b2e

File tree

5 files changed

+53
-3
lines changed

5 files changed

+53
-3
lines changed

‎src/css/group.css‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
padding-left:calc(var(--layout-space) *var(--layout-padding));
55
padding-right:calc(var(--layout-space) *var(--layout-padding));
66
width:var(--link-area-width);
7+
display: flex;
8+
}
9+
10+
.is-group-order-headerbody .group{
11+
flex-direction: column;
12+
}
13+
14+
.is-group-order-bodyheader .group{
15+
flex-direction: column-reverse;
716
}
817

918
.group:first-child{
@@ -45,10 +54,14 @@
4554
justify-content: flex-start;
4655
}
4756

48-
.is-group-name-show .group-header,
49-
.is-link-edit .group-header{
57+
.is-group-order-headerbody.is-group-name-show .group-header,
58+
.is-group-order-headerbody.is-link-edit .group-header{
5059
padding-bottom:calc(var(--layout-space) *var(--layout-gutter));
51-
transition: padding var(--layout-timing-extra-fast);
60+
}
61+
62+
.is-group-order-bodyheader.is-group-name-show .group-header,
63+
.is-group-order-bodyheader.is-link-edit .group-header{
64+
padding-top:calc(var(--layout-space) *var(--layout-gutter));
5265
}
5366

5467
.group-name{

‎src/index.html‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,21 @@ <h1 class="menu-item-header-text">Names</h1>
823823
<pclass="control-group-area-alignment-helper form-helper small">Effects may not be visible if the Group Name is not shown.</p>
824824
</div>
825825
</div>
826+
<divclass="menu-item">
827+
<divclass="menu-item-header">
828+
<h1class="menu-item-header-text">Order</h1>
829+
</div>
830+
<divclass="menu-item-form">
831+
<divclass="input-wrap">
832+
<inputid="control-group-order-headerbody" class="control-group-order-headerbody" type="radio" name="control-group-order" value="headerbody" tabindex="1">
833+
<labelfor="control-group-order-headerbody"><spanclass="label-icon"></span> Group Name then Bookmarks</label>
834+
</div>
835+
<divclass="input-wrap">
836+
<inputid="control-group-order-bodyheader" class="control-group-order-bodyheader" type="radio" name="control-group-order" value="bodyheader" tabindex="1">
837+
<labelfor="control-group-order-bodyheader"><spanclass="label-icon"></span> Bookmarks then Group Name</label>
838+
</div>
839+
</div>
840+
</div>
826841
<divclass="menu-item">
827842
<divclass="menu-item-header">
828843
<h1class="menu-item-header-text">Border</h1>

‎src/js/control.js‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,6 +1723,20 @@ var control = (function(){
17231723
func: function(){
17241724
render.class();
17251725
}
1726+
},{
1727+
element: helper.e(".control-group-order-headerbody"),
1728+
path: "group.order",
1729+
type: "radio",
1730+
func: function(){
1731+
render.class();
1732+
}
1733+
},{
1734+
element: helper.e(".control-group-order-bodyheader"),
1735+
path: "group.order",
1736+
type: "radio",
1737+
func: function(){
1738+
render.class();
1739+
}
17261740
},{
17271741
element: helper.e(".control-group-border"),
17281742
path: "group.border",
@@ -2695,6 +2709,11 @@ var control = (function(){
26952709
helper.removeClass(html,"is-group-name-show");
26962710
};
26972711
};
2712+
var_order=function(){
2713+
helper.removeClass(html,"is-group-order-headerbody");
2714+
helper.removeClass(html,"is-group-order-bodyheader");
2715+
helper.addClass(html,"is-group-order-"+state.get().group.order);
2716+
};
26982717
var_border=function(){
26992718
helper.removeClass(html,"is-group-border");
27002719
if(state.get().group.border>0){
@@ -2703,6 +2722,7 @@ var control = (function(){
27032722
};
27042723
_area();
27052724
_name();
2725+
_order();
27062726
_border();
27072727
};
27082728
var_link=function(){

‎src/js/state.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ var state = (function(){
185185
size: 1
186186
},
187187
border: 0,
188+
order: "headerbody",
188189
add: false
189190
},
190191
layout: {

‎src/js/update.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ var update = (function(){
634634
size: 1
635635
},
636636
border: 0,
637+
order: "headerbody",
637638
add: false
638639
};
639640
data.state.dropdown=false;

0 commit comments

Comments
(0)