Skip to content

Commit 572afba

Browse files
authored
Merge pull request #26 from eddybordi/patch-1
Bug when more than two files are added
2 parents 9b4a186 + 412b32f commit 572afba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/twirl/gitbucket/gist/edit.scala.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ <h1 style="margin: 0px;">New snippet</h1>
8181
});
8282

8383
$('#add_file').click(function(){
84-
var count = $('#count').val();
84+
var count = parseInt($('#count').val());
8585
$.get('@path/gist/_add?count=' + count, function(html){
8686
$('#editors').append(html);
8787
$('#count').val(count + 1);
@@ -95,7 +95,7 @@ <h1 style="margin: 0px;">New snippet</h1>
9595
});
9696

9797
$('.submit_snippet').click(function(){
98-
var count = $('#count').val();
98+
var count = parseInt($('#count').val());
9999
if(count == 0){
100100
displayError('File is required.');
101101
return false;
@@ -130,4 +130,4 @@ <h1 style="margin: 0px;">New snippet</h1>
130130
}
131131
});
132132
</script>
133-
}
133+
}

0 commit comments

Comments
 (0)