mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
select active element in edit.js after change
This commit is contained in:
parent
fc1a154a6a
commit
342fc07d29
1 changed files with 9 additions and 15 deletions
|
@ -546,17 +546,11 @@
|
|||
|
||||
disableProperties();
|
||||
} else {
|
||||
var activeElement = document.activeElement;
|
||||
|
||||
try {
|
||||
var selected = (activeElement
|
||||
&& activeElement.selectionStart == 0
|
||||
&& activeElement.selectionEnd == activeElement.value.length);
|
||||
} catch (e) {
|
||||
var selected = false;
|
||||
}
|
||||
|
||||
|
||||
properties = data.selections[0].properties;
|
||||
|
||||
//WE SHOULD ONLY UPDATE CHANGED VALUES
|
||||
elID.innerHTML = properties.id;
|
||||
|
||||
elType.innerHTML = properties.type;
|
||||
|
@ -572,6 +566,7 @@
|
|||
enableProperties();
|
||||
}
|
||||
|
||||
console.log('updated properties :: ',properties)
|
||||
|
||||
elName.value = properties.name;
|
||||
|
||||
|
@ -811,11 +806,10 @@
|
|||
elYTextureURL.value = properties.yTextureURL;
|
||||
elZTextureURL.value = properties.zTextureURL;
|
||||
}
|
||||
|
||||
if (selected) {
|
||||
activeElement.focus();
|
||||
activeElement.select();
|
||||
}
|
||||
|
||||
var activeElement = document.activeElement;
|
||||
|
||||
activeElement.select();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1178,7 +1172,7 @@
|
|||
for (var i = 0; i < els.length; i++) {
|
||||
var clicked = false;
|
||||
var originalText;
|
||||
els[i].onfocus = function() {
|
||||
els[i].onfocus = function(e) {
|
||||
originalText = this.value;
|
||||
this.select();
|
||||
clicked = false;
|
||||
|
|
Loading…
Reference in a new issue