File tree Expand file tree Collapse file tree 4 files changed +22
-6
lines changed
Expand file tree Collapse file tree 4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " cache-visual-editor" ,
33 "printableName" : " Cache Visual Editor" ,
4- "version" : " 0.3.0 " ,
4+ "version" : " 0.3.1 " ,
55 "description" : " Visual class editor for InterSystems Caché" ,
66 "main" : " index.js" ,
77 "keywords" : [
Original file line number Diff line number Diff line change 1919 < div class ="medium menu icon "> </ div >
2020 < div class ="medium back icon " id ="backButton "> </ div >
2121 < span class ="title ">
22- < select id ="topNamespace ">
22+ < select id ="topNamespace " class =" topNamespace " >
2323 < option > Loading...</ option >
2424 </ select > < span id ="topTitle "> </ span >
2525 </ span >
Original file line number Diff line number Diff line change @@ -34,12 +34,30 @@ let backButton = onInit(() => {
3434 if ( ns === data [ "namespace" ] ) c . setAttribute ( "selected" , "true" ) ;
3535 topNamespace . appendChild ( c ) ;
3636 }
37+ updateHeaderNamespaceWidth ( NAMESPACE ) ;
3738 topNamespace . addEventListener ( "change" , ( e ) => {
3839 NAMESPACE = ( e . target || e . srcElement ) . value ;
40+ updateHeaderNamespaceWidth ( NAMESPACE ) ;
3941 loadLevel ( "" ) ;
4042 } ) ;
4143 } ) ;
4244
45+ /**
46+ * This function uses a bit of trick to compute the width of the namespace element in header, but it
47+ * does its job.
48+ * @param {string } namespace
49+ */
50+ function updateHeaderNamespaceWidth ( namespace ) {
51+ let temp = block ( "select" , "topNamespace" ) ,
52+ t2 = block ( "option" ) ;
53+ t2 . setAttribute ( "selected" , "true" ) ;
54+ t2 . textContent = namespace ;
55+ temp . appendChild ( t2 ) ;
56+ topNamespace . parentNode . appendChild ( temp ) ;
57+ topNamespace . style . width = temp . offsetWidth + "px" ;
58+ topNamespace . parentNode . removeChild ( temp ) ;
59+ }
60+
4361function orderData ( data ) {
4462 var sortable = [ ] ,
4563 sorted = { } ;
Original file line number Diff line number Diff line change @@ -45,17 +45,15 @@ html, body {
4545 font-weight : bold ;
4646 vertical-align : middle ;
4747
48- # topNamespace {
48+ . topNamespace {
4949
5050 background : none ;
5151 border : none ;
5252 font : inherit ;
53- outline : none ;
53+ outline : 0 ;
5454 -webkit-appearance : none ;
5555 -moz-appearance : none ;
5656 appearance : none ;
57- text-indent : 1px ;
58- text-overflow : ' ' ;
5957 cursor : pointer ;
6058 @include transition ($defaultTransition );
6159
You can’t perform that action at this time.
0 commit comments