@@ -33,6 +33,8 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
3333 this . setPriority ( osparc . dashboard . CardBase . CARD_PRIORITY . ITEM ) ;
3434
3535 this . addListener ( "tap" , this . __itemSelected , this ) ;
36+
37+ this . addListener ( "changeSelected" , this . __evalSelectedButton , this ) ;
3638 } ,
3739
3840 statics : {
@@ -179,11 +181,9 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
179181 // overridden
180182 _applyMultiSelectionMode : function ( value ) {
181183 if ( value ) {
182- const menuButton = this . getChildControl ( "menu-button" ) ;
183- menuButton . setVisibility ( "excluded" ) ;
184- this . __itemSelected ( ) ;
184+ this . __evalSelectedButton ( ) ;
185185 } else {
186- this . __showMenuOnly ( ) ;
186+ this . setSelected ( false ) ;
187187 }
188188 } ,
189189
@@ -193,26 +193,23 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
193193 return ;
194194 }
195195
196- if ( this . isResourceType ( "study" ) && this . isMultiSelectionMode ( ) ) {
197- const selected = this . getSelected ( ) ;
198-
199- const tick = this . getChildControl ( "tick-selected" ) ;
200- tick . setVisibility ( selected ? "visible" : "excluded" ) ;
201-
202- const untick = this . getChildControl ( "tick-unselected" ) ;
203- untick . setVisibility ( selected ? "excluded" : "visible" ) ;
204- } else {
205- this . __showMenuOnly ( ) ;
206- }
196+ this . setSelected ( ! this . getSelected ( ) ) ;
207197 } ,
208198
209- __showMenuOnly : function ( ) {
199+ __evalSelectedButton : function ( ) {
200+ const selected = this . getSelected ( ) ;
210201 const menuButton = this . getChildControl ( "menu-button" ) ;
211- menuButton . setVisibility ( "visible" ) ;
212202 const tick = this . getChildControl ( "tick-selected" ) ;
213- tick . setVisibility ( "excluded" ) ;
214203 const untick = this . getChildControl ( "tick-unselected" ) ;
215- untick . setVisibility ( "excluded" ) ;
204+ if ( this . isResourceType ( "study" ) && this . isMultiSelectionMode ( ) ) {
205+ menuButton . setVisibility ( "excluded" ) ;
206+ tick . setVisibility ( selected ? "visible" : "excluded" ) ;
207+ untick . setVisibility ( selected ? "excluded" : "visible" ) ;
208+ } else {
209+ menuButton . setVisibility ( "visible" ) ;
210+ tick . setVisibility ( "excluded" ) ;
211+ untick . setVisibility ( "excluded" ) ;
212+ }
216213 } ,
217214
218215 // overridden
0 commit comments