settings: Add a block comment explaining the auto-discard feature.

This should help make this code more readable (I found it hard to
understand while reviewing #13030).
This commit is contained in:
Tim Abbott
2019-08-21 16:48:38 -07:00
parent ff26858e44
commit 5c49133754

View File

@@ -661,6 +661,12 @@ exports.build_page = function () {
e.preventDefault();
e.stopPropagation();
// This event handler detects whether after these input
// changes, any fields have different values from the current
// official values stored in the database and page_params. If
// they do, we transition to the "unsaved" state showing the
// save/discard widget; otherwise, we hide that widget (the
// "discarded" state).
var subsection = $(e.target).closest('.org-subsection-parent');
subsection.find('.subsection-failed-status p').hide();
subsection.find('.save-button').show();