From 47336279a4376a0fdecd811ad0dd19471c9e9793 Mon Sep 17 00:00:00 2001 From: Silver Kuusik Date: Sun, 8 Apr 2018 20:53:30 +0300 Subject: [PATCH] remove "sumo-" value on input blur --- assets/js/sumorobot.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/assets/js/sumorobot.js b/assets/js/sumorobot.js index 1fd71e0..37ed4df 100755 --- a/assets/js/sumorobot.js +++ b/assets/js/sumorobot.js @@ -528,6 +528,15 @@ window.onload = function() { $("#robot-id").val("sumo-"); } }); + + /* when robot-id input field gets unfocused */ + $("#robot-id").focus(function() { + /* if the robot-id input value is the previously set "sumo-" */ + if ($("#robot-id").val() === "sumo-") { + /* remove the value */ + $("#robot-id").val(""); + } + }); /* robot number button listener */ $(".btn-robot-go").click(function() {