File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -139,16 +139,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
139139 setIcon : function ( menuButton , icon , resourceMetadata ) {
140140 const source = icon ? icon : osparc . utils . Utils . getIconFromResource ( resourceMetadata ) ;
141141 if ( source ) {
142- const thumbnail = new osparc . ui . basic . Thumbnail ( source , 24 , 24 ) . set ( {
143- minHeight : 24 ,
144- minWidth : 24 ,
145- } ) ;
146- thumbnail . getChildControl ( "image" ) . set ( {
147- anonymous : true ,
148- decorator : "rounded" ,
149- } ) ;
150- // eslint-disable-next-line no-underscore-dangle
151- menuButton . _add ( thumbnail , { column : 0 } ) ;
142+ osparc . utils . Utils . replaceIconWithThumbnail ( menuButton , source , 24 ) ;
152143 }
153144 } ,
154145 } ,
Original file line number Diff line number Diff line change @@ -91,6 +91,21 @@ qx.Class.define("osparc.utils.Utils", {
9191
9292 FLOATING_Z_INDEX : 1000001 + 1 ,
9393
94+ replaceIconWithThumbnail : function ( widget , thumbnailUrl , size = 24 ) {
95+ if ( thumbnailUrl ) {
96+ const thumbnail = new osparc . ui . basic . Thumbnail ( thumbnailUrl , size , size ) . set ( {
97+ minHeight : size ,
98+ minWidth : size ,
99+ } ) ;
100+ thumbnail . getChildControl ( "image" ) . set ( {
101+ anonymous : true ,
102+ decorator : "rounded" ,
103+ } ) ;
104+ // eslint-disable-next-line no-underscore-dangle
105+ widget . _add ( thumbnail , { column : 0 } ) ;
106+ }
107+ } ,
108+
94109 disableAutocomplete : function ( control ) {
95110 if ( control && control . getContentElement ( ) ) {
96111 control . getContentElement ( ) . setAttribute ( "autocomplete" , "off" ) ;
You can’t perform that action at this time.
0 commit comments