Commit a30e7dc4 authored by haemmer's avatar haemmer

Value of text field is now restored on focus out if nothing was chosen

parent 07188ef3
......@@ -196,7 +196,17 @@ function getTextElement(sourceElement, imgElement) {
// Clear text area on click
newTextElement.click(function (obj) {
obj.target.value = "";
if (obj.target.value != ''){
obj.target.savedValue = obj.target.value;
obj.target.value = '';
}
});
// Restore text area on focos out
newTextElement.focusout(function (obj) {
if (obj.target.value == '' && obj.target.savedValue != ''){
obj.target.value = obj.target.savedValue;
}
});
return newTextElement;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment