File tree Expand file tree Collapse file tree 3 files changed +51
-12
lines changed Expand file tree Collapse file tree 3 files changed +51
-12
lines changed Original file line number Diff line number Diff line change
1
+ li.list-group-item
2
+ .close-icon ( data-hook ='close' )
3
+ i.fa.fa-close
4
+ a( data-hook ='name' )
Original file line number Diff line number Diff line change @@ -4,21 +4,33 @@ var Connection = require('../models/connection');
4
4
var format = require ( 'util' ) . format ;
5
5
var $ = require ( 'jquery' ) ;
6
6
var app = require ( 'ampersand-app' ) ;
7
+ var debug = require ( 'debug' ) ( 'scout:connect:index' ) ;
7
8
8
9
var ConnectionView = View . extend ( {
9
10
props : {
10
- model : Connection
11
- } ,
11
+ model : Connection ,
12
+ hover : {
13
+ type : 'boolean' ,
14
+ default : false
15
+ }
16
+ } ,
12
17
events : {
13
- click : 'onClick' ,
14
- dblclick : 'onDoubleClick'
18
+ 'click' : 'onClick' ,
19
+ 'dblclick' : 'onDoubleClick' ,
20
+ 'mouseover' : 'onMouseOver' ,
21
+ 'mouseout' : 'onMouseOut' ,
22
+ 'click [data-hook=close]' : 'onCloseClick'
15
23
} ,
16
24
bindings : {
17
25
'model.name' : {
18
26
hook : 'name'
27
+ } ,
28
+ 'hover' : {
29
+ type : 'toggle' ,
30
+ hook : 'close'
19
31
}
20
32
} ,
21
- template : '<li class="list-group-item"><a data-hook="name"></a></li>' ,
33
+ template : require ( './connection.jade' ) ,
22
34
onClick : function ( event ) {
23
35
event . stopPropagation ( ) ;
24
36
event . preventDefault ( ) ;
@@ -30,6 +42,17 @@ var ConnectionView = View.extend({
30
42
onDoubleClick : function ( event ) {
31
43
this . onClick ( event ) ;
32
44
this . parent . parent . onSubmit ( event ) ;
45
+ } ,
46
+ onCloseClick : function ( event ) {
47
+ event . stopPropagation ( ) ;
48
+ event . preventDefault ( ) ;
49
+ this . model . destroy ( ) ;
50
+ } ,
51
+ onMouseOver : function ( event ) {
52
+ this . hover = true ;
53
+ } ,
54
+ onMouseOut : function ( event ) {
55
+ this . hover = false ;
33
56
}
34
57
} ) ;
35
58
Original file line number Diff line number Diff line change 59
59
background : none ;
60
60
color : @gray5 ;
61
61
62
+ & :hover {
63
+ background : lighten (@slate0 , 5% );
64
+ a {
65
+ color : @pw ;
66
+ border-left : 4px solid lighten (@slate0 , 5% );
67
+ text-decoration : none ;
68
+ }
69
+ }
70
+
62
71
a {
63
72
display : block ;
64
73
color : @gray5 ;
68
77
overflow : hidden ;
69
78
text-overflow : ellipsis ;
70
79
border-left : 4px solid transparent ;
71
-
72
- & :hover {
73
- color : @pw ;
74
- text-decoration : none ;
75
- background : lighten (@slate0 , 5% );
76
- border-left : 4px solid lighten (@slate0 , 5% );
77
- }
78
80
}
81
+
79
82
i {
80
83
color : lighten (@text-color , 40% );
81
84
line-height : 24px ;
97
100
98
101
}
99
102
}
103
+
104
+ .close-icon {
105
+ position : absolute ;
106
+ right : 0px ;
107
+
108
+ & :hover i {
109
+ color : @pw ;
110
+ }
111
+ }
100
112
}
101
113
}
102
114
.sidebar-controls {
You can’t perform that action at this time.
0 commit comments