File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,13 @@ var ConnectView = View.extend({
197197 this . authMethod = null ;
198198 this . authOpen = false ;
199199 } ,
200+ onConnectionDestroyed : function ( ) {
201+ this . reset ( ) ;
202+ this . form . connection_id = '' ;
203+ this . form . reset ( ) ;
204+ this . authMethod = null ;
205+ this . authOpen = false ;
206+ } ,
200207
201208 /**
202209 * Triggers when the auth methods has changed (or set back to null)
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ var SidebarItemView = View.extend({
1919 dblclick : 'onDoubleClick' ,
2020 mouseover : 'onMouseOver' ,
2121 mouseout : 'onMouseOut' ,
22- 'click [data-hook=close]' : 'onCloseClick '
22+ 'click [data-hook=close]' : 'onRemoveClick '
2323 } ,
2424 bindings : {
2525 'model.name' : {
@@ -51,10 +51,11 @@ var SidebarItemView = View.extend({
5151 onDoubleClick : function ( event ) {
5252 this . parent . onItemDoubleClick ( event , this ) ;
5353 } ,
54- onCloseClick : function ( event ) {
54+ onRemoveClick : function ( event ) {
5555 event . stopPropagation ( ) ;
5656 event . preventDefault ( ) ;
5757 this . model . destroy ( ) ;
58+ this . parent . onRemoveClick ( event , this ) ;
5859 } ,
5960 onMouseOver : function ( ) {
6061 this . hover = true ;
@@ -93,6 +94,12 @@ var SidebarView = View.extend({
9394 }
9495 this . parent . createNewConnection ( ) ;
9596 } ,
97+ onRemoveClick : function ( event , view ) {
98+ event . stopPropagation ( ) ;
99+ event . preventDefault ( ) ;
100+ view . model . destroy ( ) ;
101+ this . parent . onConnectionDestroyed ( ) ;
102+ } ,
96103 onItemClick : function ( event , view ) {
97104 event . stopPropagation ( ) ;
98105 event . preventDefault ( ) ;
You can’t perform that action at this time.
0 commit comments