Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Bug 1339118 - Fix "Gimme a firefox" forgets about the revision it aut… #149

Merged
merged 2 commits into from
Feb 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions kickoff/static/suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,17 @@ function setupVersionSuggestions(versionElement, versions, buildNumberElement, b
}).focus(function() {
$(this).autocomplete('search');
}).change(function() {
var productName = this.name.slice(0, -VERSION_SUFFIX.length);
populateAllPossibleFields(productName, this.value, buildNumberElement, previousBuilds, partialElement);
// This setTimeout prevents bug 1339118 from happening. It solves the case where: a version has been picked
// via `select` and then the form is submit via a click on it. This click triggers a `change` event, which
// causes some fields (like revision of l10n changesets) to be cleared right before the form is submitted.
//
// Putting a setTimeout without a time makes the call to `populateAllPossibleFields()` happen when the event
// loop is free. Because, submitting a form keeps the event loop busy, `populateAllPossibleFields()` is not
// called right before the submission.
setTimeout(function() {
var productName = this.name.slice(0, -VERSION_SUFFIX.length);
populateAllPossibleFields(productName, this.value, buildNumberElement, previousBuilds, partialElement);
}.bind(this));
});
}

Expand Down