Fix edit.js not selecting all when tabbing between properties

This commit is contained in:
Ryan Huffman 2015-03-31 10:51:07 -07:00
parent 0c9e6ad3c0
commit 79305141d1

View file

@ -210,6 +210,9 @@
disableChildren(document.getElementById("properties-list"), 'input');
} else {
var activeElement = document.activeElement;
var selected = activeElement.selectionStart == 0 && activeElement.selectionEnd == activeElement.value.length;
var properties = data.selections[0].properties;
elID.innerHTML = properties.id;
@ -335,6 +338,11 @@
elLightExponent.value = properties.exponent;
elLightCutoff.value = properties.cutoff;
}
if (selected) {
activeElement.focus();
activeElement.select();
}
}
}
});