@@ -35,8 +35,7 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
3535
3636 events : {
3737 "trashContext" : "qx.event.type.Event" ,
38- "templatesContext" : "qx.event.type.Event" ,
39- "servicesContext" : "qx.event.type.Event" ,
38+ "changeTab" : "qx.event.type.Data" ,
4039 "trashStudyRequested" : "qx.event.type.Data" ,
4140 "trashFolderRequested" : "qx.event.type.Data" ,
4241 "changeSharedWith" : "qx.event.type.Data" ,
@@ -89,8 +88,6 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
8988 this . __workspacesAndFoldersTree . contextChanged ( context ) ;
9089
9190 this . __trashButton . setValue ( context === "trash" ) ;
92- this . __templatesButton . setValue ( context === "templates" ) ;
93- this . __servicesButton . setValue ( context === "services" ) ;
9491 } ,
9592
9693 /* WORKSPACES AND FOLDERS */
@@ -224,38 +221,26 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
224221 firstUpperCase : true ,
225222 plural : true
226223 } ) ;
227- const templatesButton = this . __templatesButton = new qx . ui . toolbar . RadioButton ( ) . set ( {
228- value : false ,
224+ const templatesButton = new qx . ui . toolbar . Button ( ) . set ( {
229225 appearance : "filter-toggle-button" ,
230226 label : templateAlias ,
231227 icon : "@FontAwesome5Solid/copy/16" ,
232228 paddingLeft : 10 , // align it with the context
233229 } ) ;
234230 osparc . utils . Utils . setIdToWidget ( templatesButton , "templatesTabBtn" ) ;
235- templatesButton . addListener ( "changeValue" , e => {
236- const trashEnabled = e . getData ( ) ;
237- if ( trashEnabled ) {
238- this . fireEvent ( "templatesContext" ) ;
239- }
240- } ) ;
231+ templatesButton . addListener ( "tap" , ( ) => this . fireDataEvent ( "changeTab" , "templatesTab" ) ) ;
241232 return templatesButton ;
242233 } ,
243234
244235 __createServices : function ( ) {
245- const servicesButton = this . __servicesButton = new qx . ui . toolbar . RadioButton ( ) . set ( {
246- value : false ,
236+ const servicesButton = new qx . ui . toolbar . Button ( ) . set ( {
247237 appearance : "filter-toggle-button" ,
248238 label : this . tr ( "Services" ) ,
249239 icon : "@FontAwesome5Solid/cogs/16" ,
250240 paddingLeft : 10 , // align it with the context
251241 } ) ;
252242 osparc . utils . Utils . setIdToWidget ( servicesButton , "servicesTabBtn" ) ;
253- servicesButton . addListener ( "changeValue" , e => {
254- const trashEnabled = e . getData ( ) ;
255- if ( trashEnabled ) {
256- this . fireEvent ( "servicesContext" ) ;
257- }
258- } ) ;
243+ servicesButton . addListener ( "tap" , ( ) => this . fireDataEvent ( "changeTab" , "servicesTab" ) ) ;
259244 return servicesButton ;
260245 } ,
261246
0 commit comments