From 09837bd2fa6698107ae680eefa19ac4dab2aef68 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Wed, 17 Oct 2018 13:57:01 -0500 Subject: [PATCH] Require unlock to delete --- app/assets/javascripts/app/controllers/editor.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/javascripts/app/controllers/editor.js b/app/assets/javascripts/app/controllers/editor.js index 5a1650829..e040a8535 100644 --- a/app/assets/javascripts/app/controllers/editor.js +++ b/app/assets/javascripts/app/controllers/editor.js @@ -373,6 +373,11 @@ angular.module('app') } this.deleteNote = function() { + if(this.note.locked) { + alert("This note is locked. If you'd like to delete it, unlock it, and try again."); + return; + } + let title = this.note.safeTitle().length ? `'${this.note.title}'` : "this note"; if(confirm(`Are you sure you want to delete ${title}?`)) { this.remove()(this.note);