Skip to content

Commit 6ad1fcd

Browse files
authored
replaced var with const (daattali#1049)
1 parent 685cf73 commit 6ad1fcd

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

assets/js/staticman.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,25 @@ layout: null
33
---
44

55
(function ($) {
6-
var $comments = $('.js-comments');
7-
86
$('#new_comment').submit(function () {
9-
var form = this;
7+
const form = this;
108

119
$(form).addClass('disabled');
1210

1311
{% assign sm = site.staticman -%}
14-
var endpoint = '{{ sm.endpoint }}';
15-
var repository = '{{ sm.repository }}';
16-
var branch = '{{ sm.branch }}';
17-
let url = endpoint + repository + '/' + branch + '/comments';
18-
let data = $(this).serialize();
12+
const endpoint = '{{ sm.endpoint }}';
13+
const repository = '{{ sm.repository }}';
14+
const branch = '{{ sm.branch }}';
15+
const url = endpoint + repository + '/' + branch + '/comments';
16+
const data = $(this).serialize();
1917

20-
var xhr = new XMLHttpRequest();
18+
const xhr = new XMLHttpRequest();
2119
xhr.open("POST", url);
2220
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
2321
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
2422
xhr.onreadystatechange = function () {
2523
if(xhr.readyState === XMLHttpRequest.DONE) {
26-
var status = xhr.status;
24+
const status = xhr.status;
2725
if (status >= 200 && status < 400) {
2826
formSubmitted();
2927
} else {

0 commit comments

Comments
 (0)