@@ -164,7 +164,7 @@ Extras.Sync.ListViewer = Core.extend(Echo.Render.ComponentSync, {
164164 this . _setHighlight ( index , false ) ;
165165 } ,
166166
167- _processClick : function ( e ) {
167+ _processClick : function ( e , contextClick ) {
168168 if ( ! this . client || ! this . client . verifyInput ( this . component ) ) {
169169 return ;
170170 }
@@ -175,7 +175,7 @@ Extras.Sync.ListViewer = Core.extend(Echo.Render.ComponentSync, {
175175
176176 if ( e . ctrlKey || e . metaKey || e . altKey ) {
177177 var selection = this . component . get ( "selection" ) || { } ;
178- if ( selection [ index ] ) {
178+ if ( ! contextClick && selection [ index ] ) {
179179 delete selection [ index ] ;
180180 } else {
181181 selection [ index ] = true ;
@@ -200,6 +200,11 @@ Extras.Sync.ListViewer = Core.extend(Echo.Render.ComponentSync, {
200200 this . _setHighlight ( index , true ) ;
201201 }
202202 } ,
203+
204+ _processContextMenu : function ( e ) {
205+ this . _processClick ( e , true ) ;
206+ return true ;
207+ } ,
203208
204209 _processDoubleClick : function ( e ) {
205210 if ( ! this . client || ! this . client . verifyInput ( this . component ) ) {
@@ -260,6 +265,7 @@ Extras.Sync.ListViewer = Core.extend(Echo.Render.ComponentSync, {
260265 this . _createProtoCell ( ) ;
261266
262267 Core . Web . Event . add ( this . _div , "click" , Core . method ( this , this . _processClick ) , false ) ;
268+ Core . Web . Event . add ( this . _div , "contextmenu" , Core . method ( this , this . _processContextMenu ) , false ) ;
263269 Core . Web . Event . add ( this . _div , "dblclick" , Core . method ( this , this . _processDoubleClick ) , false ) ;
264270 if ( this . component . render ( "rolloverEnabled" ) ) {
265271 Core . Web . Event . add ( this . _div , "mouseover" , Core . method ( this , this . _processRolloverEnter ) , false ) ;
0 commit comments