settings: Fix whitespace leak in organization description.

Previously, the way the organization description textarea was
generated, there'd be a newline and ~12 spaces added each time on
reloaded the page and hit "save changes".

This change makes it so that the organization description only changes
when the user actually changes it.
This commit is contained in:
Tim Abbott 2017-05-17 12:11:10 -07:00
parent ed767481f5
commit e12d3100db
2 changed files with 2 additions and 3 deletions

View File

@ -176,7 +176,7 @@ exports.set_up = function () {
e.stopPropagation(); e.stopPropagation();
var new_name = $("#id_realm_name").val(); var new_name = $("#id_realm_name").val();
var new_description = $("#id_realm_description").val(); var new_description = $("#id_realm_description").val().trim();
var new_restricted = $("#id_realm_restricted_to_domain").prop("checked"); var new_restricted = $("#id_realm_restricted_to_domain").prop("checked");
var new_invite = $("#id_realm_invite_required").prop("checked"); var new_invite = $("#id_realm_invite_required").prop("checked");
var new_invite_by_admins_only = $("#id_realm_invite_by_admins_only").prop("checked"); var new_invite_by_admins_only = $("#id_realm_invite_by_admins_only").prop("checked");

View File

@ -26,8 +26,7 @@
<div class="input-group admin-realm"> <div class="input-group admin-realm">
<label for="realm_description">{{t "Your organization's description" }}</label> <label for="realm_description">{{t "Your organization's description" }}</label>
<textarea id="id_realm_description" name="realm_description" class="admin-realm-description" <textarea id="id_realm_description" name="realm_description" class="admin-realm-description"
maxlength="1000">{{ realm_description }} maxlength="1000">{{ realm_description }}</textarea>
</textarea>
</div> </div>
<div class="input-group admin-restricted-to-domain"> <div class="input-group admin-restricted-to-domain">
<label class="checkbox"> <label class="checkbox">