@@ -14,6 +14,9 @@ qx.Class.define("osparc.form.tag.TagItem", {
1414 construct : function ( ) {
1515 this . base ( arguments ) ;
1616 this . _setLayout ( new qx . ui . layout . HBox ( 5 ) ) ;
17+ this . set ( {
18+ alignY : "middle" ,
19+ } ) ;
1720 this . __validationManager = new qx . ui . form . validation . Manager ( ) ;
1821 } ,
1922
@@ -94,25 +97,26 @@ qx.Class.define("osparc.form.tag.TagItem", {
9497 let control ;
9598 switch ( id ) {
9699 case "tag" :
97- control = new osparc . ui . basic . Tag ( ) ;
100+ control = new osparc . ui . basic . Tag ( ) . set ( {
101+ alignY : "middle" ,
102+ } ) ;
98103 this . bind ( "name" , control , "value" ) ;
99104 this . bind ( "color" , control , "color" ) ;
100105 break ;
101106 case "description" :
102107 control = new qx . ui . basic . Label ( ) . set ( {
103108 rich : true ,
104109 allowGrowX : true ,
110+ alignY : "middle" ,
105111 } ) ;
106112 this . bind ( "description" , control , "value" ) ;
107113 break ;
108114 case "shared-icon" :
109115 control = new qx . ui . basic . Image ( ) . set ( {
110116 minWidth : 30 ,
111117 alignY : "middle" ,
112- cursor : "pointer" ,
113118 } ) ;
114- osparc . dashboard . CardBase . populateShareIcon ( control , this . getAccessRights ( ) )
115- control . addListener ( "tap" , ( ) => this . __openAccessRights ( ) , this ) ;
119+ osparc . dashboard . CardBase . populateShareIcon ( control , this . getAccessRights ( ) ) ;
116120 break ;
117121 case "name-input" :
118122 control = new qx . ui . form . TextField ( ) . set ( {
@@ -202,7 +206,6 @@ qx.Class.define("osparc.form.tag.TagItem", {
202206 this . _add ( this . getChildControl ( "description" ) , {
203207 flex : 1
204208 } ) ;
205- this . _add ( this . getChildControl ( "shared-icon" ) ) ;
206209 this . _add ( this . __tagItemButtons ( ) ) ;
207210 this . resetBackgroundColor ( ) ;
208211 } ,
@@ -227,29 +230,40 @@ qx.Class.define("osparc.form.tag.TagItem", {
227230 __tagItemButtons : function ( ) {
228231 const canIWrite = osparc . share . CollaboratorsTag . canIWrite ( this . getMyAccessRights ( ) ) ;
229232 const canIDelete = osparc . share . CollaboratorsTag . canIDelete ( this . getMyAccessRights ( ) ) ;
233+ const buttonContainer = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 5 ) ) ;
234+
235+ const sharedIcon = this . getChildControl ( "shared-icon" ) ;
236+ sharedIcon . set ( {
237+ cursor : canIWrite ? "pointer" : null ,
238+ } ) ;
239+ if ( canIWrite ) {
240+ sharedIcon . addListener ( "tap" , ( ) => this . __openAccessRights ( ) , this ) ;
241+ }
242+ buttonContainer . add ( sharedIcon ) ;
230243
231- const buttonContainer = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( ) ) ;
232244 const editButton = new qx . ui . form . Button ( ) . set ( {
233245 icon : "@FontAwesome5Solid/pencil-alt/12" ,
234246 toolTipText : this . tr ( "Edit" ) ,
235247 enabled : canIWrite ,
236248 } ) ;
249+ buttonContainer . add ( editButton ) ;
250+ editButton . addListener ( "execute" , ( ) => this . setMode ( this . self ( ) . modes . EDIT ) , this ) ;
251+
237252 const deleteButton = new osparc . ui . form . FetchButton ( ) . set ( {
238253 appearance : "danger-button" ,
239254 icon : "@FontAwesome5Solid/trash/12" ,
240255 toolTipText : this . tr ( "Delete" ) ,
241256 enabled : canIDelete ,
242257 } ) ;
243- buttonContainer . add ( editButton ) ;
244258 buttonContainer . add ( deleteButton ) ;
245- editButton . addListener ( "execute" , ( ) => this . setMode ( this . self ( ) . modes . EDIT ) , this ) ;
246259 deleteButton . addListener ( "execute" , ( ) => {
247260 deleteButton . setFetching ( true ) ;
248261 osparc . store . Tags . getInstance ( ) . deleteTag ( this . getId ( ) )
249262 . then ( ( ) => this . fireEvent ( "deleteTag" ) )
250263 . catch ( console . error )
251264 . finally ( ( ) => deleteButton . setFetching ( false ) ) ;
252265 } , this ) ;
266+
253267 return buttonContainer ;
254268 } ,
255269 /**
0 commit comments