File tree Expand file tree Collapse file tree 4 files changed +30
-17
lines changed Expand file tree Collapse file tree 4 files changed +30
-17
lines changed Original file line number Diff line number Diff line change @@ -473,13 +473,30 @@ a {
473
473
font-weight : 600 ;
474
474
}
475
475
476
- .plusbuttoncontainer {
476
+ .instancemodsminus {
477
+ cursor : pointer ;
478
+ background-color : red ;
479
+ color : white ;
480
+ text-align : center ;
481
+ font-weight : 600 ;
482
+ width : 31px ;
483
+ float : left ;
484
+ height : 30px ;
485
+ margin : 10px ;
486
+ border-radius : 5px ;
487
+ font-size : 23px ;
488
+ }
489
+
490
+ .buttoncontainer {
477
491
width : 51px ;
478
492
height : 50px ;
493
+ display : inline ;
479
494
}
480
495
481
496
#recent {
482
497
padding-bottom : 45px ;
483
498
}
484
499
485
-
500
+ .modinputfield {
501
+ padding-bottom : 2em ;
502
+ }
Original file line number Diff line number Diff line change 7
7
< input id ="instancedescriptioninput " type ="text " placeholder ="Description... ">
8
8
</ div >
9
9
< div id ="instancebottominputcontainer ">
10
- < input class ="instancemodsinput firstmodinput " type =" email " placeholder =" Moderator email... ">
11
- < div class ="emptyinputspacer lastinputspacer ">
12
- < div class ="plusbuttoncontainer firstmodinput ">
10
+ < div class ="modinputfield ">
11
+ < input class ="instancemodsinput firstmodinput " type =" email " placeholder =" Moderator email... ">
12
+ < div class ="buttoncontainer ">
13
13
< div class ="instancemodsplus ">
14
14
+
15
15
</ div >
Original file line number Diff line number Diff line change @@ -48,19 +48,21 @@ Template.create.events({
48
48
}
49
49
} ,
50
50
'click .instancemodsplus' : function ( event , template ) {
51
- const spacers = document . getElementsByClassName ( 'emptyinputspacer' ) ;
52
- if ( spacers . length < 4 ) {
53
- $ ( '.instancemodsinput' ) . removeClass ( 'lastmodinput' ) ;
54
- $ ( '.plusbuttoncontainer' ) . removeClass ( 'lastmodinput' ) ;
51
+ const modfields = document . getElementsByClassName ( 'modinputfield' ) ;
52
+ if ( modfields . length < 4 ) {
55
53
$ ( '.instancemodsplus' ) . remove ( ) ;
56
- $ ( '<input class="instancemodsinput lastmodinput" type="text" placeholder="Moderator email..."> <div class="emptyinputspacer lastinputspacer"><div class="plusbuttoncontainer"><div class="instancemodsplus">+< /div></div></div>' ) . insertAfter ( '.lastinputspacer' ) . last ( ) ;
57
- $ ( '.lastinputspacer ' ) . first ( ) . removeClass ( 'lastinputspacer' ) ;
54
+ $ ( '.buttoncontainer' ) . last ( ) . append ( ' <div class="instancemodsminus" >x< /div>' ) ;
55
+ $ ( '<div class="modinputfield"><input class="instancemodsinput" type="text" placeholder="Moderator email..."><div class="buttoncontainer"><div class="instancemodsplus">+</div></div></div> ' ) . insertAfter ( $ ( '.modinputfield' ) . last ( ) ) ;
58
56
$ ( '#instancebottominputcontainer' ) . height ( ( index , height ) => ( height + 50 ) ) ;
59
57
} else {
60
58
showCreateError ( "You've reached the maximum # of moderators (4)." ) ;
61
59
return false ;
62
60
}
63
61
} ,
62
+ 'click .instancemodsminus' : function ( event , template ) {
63
+ event . originalEvent . path [ 2 ] . remove ( ) ;
64
+ $ ( '#instancebottominputcontainer' ) . height ( ( index , height ) => ( height - 50 ) ) ;
65
+ } ,
64
66
'click #buttonarea' : function ( event , template ) {
65
67
if ( ! Meteor . user ( ) ) {
66
68
return false ;
Original file line number Diff line number Diff line change @@ -53,12 +53,6 @@ $screen-md: 992px;
53
53
border-bottom : 1px solid #e3e3e3 ;
54
54
}
55
55
56
- .emptyinputspacer {
57
- float : right ;
58
- height : 2em ;
59
- }
60
-
61
-
62
56
.instancemodsinput {
63
57
float : left ;
64
58
width : 70% ;
You can’t perform that action at this time.
0 commit comments