File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -79,20 +79,29 @@ export function CalculateWidth({ contents, setWidth }) {
79
79
}
80
80
81
81
export function Preset ( { options, setOptions } ) {
82
- const bundlesDoc = options . bundles_doc ( ) ;
82
+ const bundlesDoc = options . bundles_doc ( ) . map ( bundle => {
83
+ bundle . doc = bundle . name + " : " + bundle . doc ;
84
+ return bundle
85
+ } ) ;
83
86
const active_bundle_name = options . get_bundle_name ( ) ;
84
87
const active_bundle = bundlesDoc . filter ( bundle => bundle . name == active_bundle_name ) . pop ( ) ;
88
+ function truncateText ( text , length ) {
89
+ return text . length <= length ? text : text . substr ( 0 , length ) + '\u2026'
90
+ }
85
91
const bundles = bundlesDoc . map ( bundle => {
86
92
return < option
87
93
key = { bundle . name }
88
94
value = { bundle . name }
89
95
title = { bundle . doc }
90
96
>
91
- { bundle . name }
97
+ { truncateText ( bundle . name , 16 ) }
92
98
</ option >
93
99
} ) ;
94
100
95
- return < OverlayTrigger placement = "bottom" overlay = { < Tooltip > { active_bundle ? active_bundle . doc : "This ruleset does not have a name" } </ Tooltip > } >
101
+ return < OverlayTrigger
102
+ placement = "bottom"
103
+ overlay = { < Tooltip > { active_bundle ? active_bundle . doc : "This ruleset does not have a name" } </ Tooltip > }
104
+ >
96
105
< Form . Select
97
106
className = "w-auto me-auto"
98
107
value = { active_bundle_name || "custom" }
You can’t perform that action at this time.
0 commit comments