consistent usage of arrow syntax instead of anonymous functions

This commit is contained in:
azivner
2017-10-09 18:53:11 -04:00
parent 49460dfb8a
commit ca87ff9215
15 changed files with 76 additions and 95 deletions

View File

@@ -41,8 +41,8 @@ function saveNoteIfChanged(callback) {
setInterval(saveNoteIfChanged, 5000);
$(document).ready(function() {
$("#noteTitle").on('input', function() {
$(document).ready(() => {
$("#noteTitle").on('input', () => {
noteChanged();
});
@@ -98,7 +98,7 @@ function saveNoteToServer(note, callback) {
type: 'PUT',
data: JSON.stringify(note),
contentType: "application/json",
success: function () {
success: () => {
isNoteChanged = false;
message("Saved!");
@@ -107,7 +107,7 @@ function saveNoteToServer(note, callback) {
callback();
}
},
error: function () {
error: () => {
error("Error saving the note!");
}
});
@@ -143,7 +143,7 @@ function createNote(node, parentKey, target, encryption) {
encryption: encryption
}),
contentType: "application/json",
success: function(result) {
success: result => {
const newNode = {
title: newNoteName,
key: result.note_id,
@@ -192,7 +192,7 @@ function setNoteBackgroundIfEncrypted(note) {
}
function loadNote(noteId) {
$.get(baseApiUrl + 'notes/' + noteId).then(function(note) {
$.get(baseApiUrl + 'notes/' + noteId).then(note => {
globalCurrentNote = note;
if (newNoteCreated) {