From 6549d4bf4164e5a8502a95ac8c1dd34660846eb8 Mon Sep 17 00:00:00 2001 From: Dennis Warren Date: Wed, 15 May 2019 13:34:38 -0700 Subject: [PATCH 1/4] Updated bulk hours page to disable buttons on save --- src/pages/VolunteersBulkEnterHours.page | 28 ++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/pages/VolunteersBulkEnterHours.page b/src/pages/VolunteersBulkEnterHours.page index d775ef7..7ead5e4 100644 --- a/src/pages/VolunteersBulkEnterHours.page +++ b/src/pages/VolunteersBulkEnterHours.page @@ -52,6 +52,28 @@ // hack that prevents Salesforce from always putting focus // on the first date field, which pops up the ugly calendar control! window.onload = function() {} + + // Function set that prevent save buttons from being clicked before + // an initial save request has completed. + function getCommandButtons(){ + var buttons = []; + buttons.push(document.getElementById('{!$Component.vfform.btnSave}')); + buttons.push(document.getElementById('{!$Component.vfform.btnSaveClose}')); + buttons.push(document.getElementById('{!$Component.vfform.btnClose}')); + return buttons; + } + function disableCommandButtons(){ + var buttons = getCommandButtons(); + buttons.forEach(function(btn){ + btn.disabled = true; + }); + } + function enableCommandButtons(){ + var buttons = getCommandButtons(); + buttons.forEach(function(btn){ + btn.disabled = false; + }); + } @@ -76,9 +98,9 @@
- - - + + +
From e259c56eabd43b358ecd17b51a26cccf99377ab0 Mon Sep 17 00:00:00 2001 From: Dennis Warren Date: Wed, 15 May 2019 13:42:17 -0700 Subject: [PATCH 2/4] JS formatting updates --- src/pages/VolunteersBulkEnterHours.page | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/VolunteersBulkEnterHours.page b/src/pages/VolunteersBulkEnterHours.page index 7ead5e4..5d1fd0d 100644 --- a/src/pages/VolunteersBulkEnterHours.page +++ b/src/pages/VolunteersBulkEnterHours.page @@ -55,22 +55,22 @@ // Function set that prevent save buttons from being clicked before // an initial save request has completed. - function getCommandButtons(){ + function getCommandButtons() { var buttons = []; - buttons.push(document.getElementById('{!$Component.vfform.btnSave}')); - buttons.push(document.getElementById('{!$Component.vfform.btnSaveClose}')); - buttons.push(document.getElementById('{!$Component.vfform.btnClose}')); + buttons.push( document.getElementById('{!$Component.vfform.btnSave}') ); + buttons.push( document.getElementById('{!$Component.vfform.btnSaveClose}') ); + buttons.push( document.getElementById('{!$Component.vfform.btnClose}') ); return buttons; } - function disableCommandButtons(){ + function disableCommandButtons() { var buttons = getCommandButtons(); - buttons.forEach(function(btn){ + buttons.forEach( function(btn) { btn.disabled = true; }); } - function enableCommandButtons(){ + function enableCommandButtons() { var buttons = getCommandButtons(); - buttons.forEach(function(btn){ + buttons.forEach( function(btn) { btn.disabled = false; }); } From 53c33f718a5fb6626540b510b62bccb202325a65 Mon Sep 17 00:00:00 2001 From: Dennis Warren Date: Thu, 16 May 2019 12:05:45 -0700 Subject: [PATCH 3/4] Updated to use VF approach --- src/pages/VolunteersBulkEnterHours.page | 50 +++++++++++-------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/src/pages/VolunteersBulkEnterHours.page b/src/pages/VolunteersBulkEnterHours.page index 5d1fd0d..ceb2d8a 100644 --- a/src/pages/VolunteersBulkEnterHours.page +++ b/src/pages/VolunteersBulkEnterHours.page @@ -52,28 +52,6 @@ // hack that prevents Salesforce from always putting focus // on the first date field, which pops up the ugly calendar control! window.onload = function() {} - - // Function set that prevent save buttons from being clicked before - // an initial save request has completed. - function getCommandButtons() { - var buttons = []; - buttons.push( document.getElementById('{!$Component.vfform.btnSave}') ); - buttons.push( document.getElementById('{!$Component.vfform.btnSaveClose}') ); - buttons.push( document.getElementById('{!$Component.vfform.btnClose}') ); - return buttons; - } - function disableCommandButtons() { - var buttons = getCommandButtons(); - buttons.forEach( function(btn) { - btn.disabled = true; - }); - } - function enableCommandButtons() { - var buttons = getCommandButtons(); - buttons.forEach( function(btn) { - btn.disabled = false; - }); - } @@ -95,14 +73,28 @@

{!$Label.labelMassEditTitle}

- -
-
- - - + +
+ + +
+ + + +
+
+
+ + +
+ + + +
+
+
-
+
From 26c6cae2181cce0ab67859eb781c28ef21269adb Mon Sep 17 00:00:00 2001 From: Dennis Warren Date: Thu, 16 May 2019 13:02:50 -0700 Subject: [PATCH 4/4] Remove unnecessary attributes --- src/pages/VolunteersBulkEnterHours.page | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/VolunteersBulkEnterHours.page b/src/pages/VolunteersBulkEnterHours.page index ceb2d8a..bda3a94 100644 --- a/src/pages/VolunteersBulkEnterHours.page +++ b/src/pages/VolunteersBulkEnterHours.page @@ -87,9 +87,9 @@
- - - + + +