Skip to content

Commit 412b32f

Browse files
author
Eddy Bordi
authored
Update edit.scala.html
Added parseInt where "count" is initialized (actually it acts as a string when you add more than two files => 0, 1, 11, 111... instead of increment the var "count").
1 parent 9b4a186 commit 412b32f

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)