From 342fc07d2904192d32283a7eddeb15c425c5507a Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 13 Jun 2016 13:06:56 -0700 Subject: [PATCH 1/3] select active element in edit.js after change --- scripts/system/html/entityProperties.html | 24 +++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/scripts/system/html/entityProperties.html b/scripts/system/html/entityProperties.html index 2a82d8fa74..1c4c3740cd 100644 --- a/scripts/system/html/entityProperties.html +++ b/scripts/system/html/entityProperties.html @@ -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; From 567118f4a9053aca53ade3fb079ba14b4a2a2491 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 13 Jun 2016 13:08:12 -0700 Subject: [PATCH 2/3] cleanup --- scripts/system/html/entityProperties.html | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/system/html/entityProperties.html b/scripts/system/html/entityProperties.html index 1c4c3740cd..ca0f9be072 100644 --- a/scripts/system/html/entityProperties.html +++ b/scripts/system/html/entityProperties.html @@ -550,7 +550,6 @@ properties = data.selections[0].properties; - //WE SHOULD ONLY UPDATE CHANGED VALUES elID.innerHTML = properties.id; elType.innerHTML = properties.type; From 188590a891010e44b0b5c188f3095db3a7af0498 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 13 Jun 2016 13:08:22 -0700 Subject: [PATCH 3/3] cleanup --- scripts/system/html/entityProperties.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/system/html/entityProperties.html b/scripts/system/html/entityProperties.html index ca0f9be072..c8edbdb369 100644 --- a/scripts/system/html/entityProperties.html +++ b/scripts/system/html/entityProperties.html @@ -564,8 +564,6 @@ } else { enableProperties(); } - - console.log('updated properties :: ',properties) elName.value = properties.name;