From 9d20875b0356cac34de8c338bfe4c4256cf72085 Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Mon, 2 Dec 2019 18:09:33 +0300 Subject: [PATCH] samba: Fix javascript constant redeclaration error Related to #1715 Signed-off-by: Veiko Aasa Reviewed-by: Joseph Nuthalapati --- plinth/modules/samba/static/samba.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plinth/modules/samba/static/samba.js b/plinth/modules/samba/static/samba.js index cc117d558..9fd6f45e1 100644 --- a/plinth/modules/samba/static/samba.js +++ b/plinth/modules/samba/static/samba.js @@ -21,10 +21,13 @@ * in this page. */ -const share_checkbox = $(".shareform > input[type='checkbox']"); -share_checkbox.change(function(event) { +$(document).on('turbolinks:load', function() { + const share_checkbox = $(".shareform > input[type='checkbox']"); + + share_checkbox.change(function(event) { this.disabled=true; this.style.cursor='wait'; this.form.submit(); + }); });