summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2016-11-03 14:54:52 +0000
committerAlex Pott2016-11-03 14:54:52 +0000
commit075aa45085c97249a8deddfb8cb978cd1ad79ec6 (patch)
tree2705a529dabb8cf0b6f195395e54bd511dbd98c1
parentef5cb440a74beb9ee3eaf47600429ce23d3b8f18 (diff)
Issue #2668596 by borisson_, droplet: No delays update for Machine Name
-rw-r--r--core/misc/machine-name.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/misc/machine-name.js b/core/misc/machine-name.js
index bbad2e3..e24cb56 100644
--- a/core/misc/machine-name.js
+++ b/core/misc/machine-name.js
@@ -71,22 +71,22 @@
xhr = null;
}
- // Wait 300 milliseconds since the last event to update the machine name
- // i.e., after the user has stopped typing.
+ // Wait 300 milliseconds for Ajax request since the last event to update
+ // the machine name i.e., after the user has stopped typing.
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
- timeout = setTimeout(function () {
- if (baseValue.toLowerCase() !== expected) {
+ if (baseValue.toLowerCase() !== expected) {
+ timeout = setTimeout(function () {
xhr = self.transliterate(baseValue, options).done(function (machine) {
self.showMachineName(machine.substr(0, options.maxlength), data);
});
- }
- else {
- self.showMachineName(expected, data);
- }
- }, 300);
+ }, 300);
+ }
+ else {
+ self.showMachineName(expected, data);
+ }
}
Object.keys(settings.machineName).forEach(function (source_id) {