Merge pull request #14310 from thoys/fix/create/tooltips-refinement

Create APP tooltip / Adressed CR comments / Regression
This commit is contained in:
Jeff Clinton 2018-11-08 10:03:17 -08:00 committed by GitHub
commit 30ff3f676a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 34 deletions

View file

@ -196,12 +196,6 @@
"particleRadius": {
"tooltip": "The size of each particle."
},
"radiusStart": {
"tooltip": ""
},
"radiusFinish": {
"tooltip": ""
},
"radiusSpread": {
"tooltip": "The spread in size that each particle is given, resulting in a variety of sizes."
},
@ -215,12 +209,6 @@
"alpha": {
"tooltip": "The alpha of each particle."
},
"alphaStart": {
"tooltip": ""
},
"alphaFinish": {
"tooltip": ""
},
"alphaSpread": {
"tooltip": "The spread in alpha that each particle is given, resulting in a variety of alphas."
},
@ -233,12 +221,6 @@
"particleSpin": {
"tooltip": "The spin of each particle in the system."
},
"spinStart": {
"tooltip": ""
},
"spinFinish": {
"tooltip": ""
},
"spinSpread": {
"tooltip": "The spread in spin that each particle is given, resulting in a variety of spins."
},
@ -248,15 +230,9 @@
"polarStart": {
"tooltip": "The angle in deg at which particles are emitted. Starts in the entity's -z direction, and rotates around its y axis."
},
"polarFinish": {
"tooltip": ""
},
"azimuthStart": {
"tooltip": "The angle in deg at which particles are emitted. Starts in the entity's -z direction, and rotates around its y axis."
},
"azimuthFinish": {
"tooltip": ""
},
"lightColor": {
"tooltip": "The color of the light emitted.",
"jsPropertyName": "color"

View file

@ -2490,6 +2490,13 @@ var PropertiesTool = function (opts) {
}
};
HMD.displayModeChanged.connect(function() {
emitScriptEvent({
type: 'hmdActiveChanged',
hmdActive: HMD.active,
});
});
createToolsWindow.webEventReceived.addListener(this, onWebEventReceived);
webView.webEventReceived.connect(onWebEventReceived);

View file

@ -1598,7 +1598,7 @@ input.rename-entity {
padding-left: 2px;
}
.createAppTooltip {
.create-app-tooltip {
position: absolute;
background: #6a6a6a;
border: 1px solid black;
@ -1607,17 +1607,16 @@ input.rename-entity {
padding: 5px;
}
.createAppTooltip .createAppTooltipDescription {
.create-app-tooltip .create-app-tooltip-description {
font-size: 12px;
font-style: italic;
color: #ffffff;
}
.createAppTooltip .createAppTooltipJSAttribute {
.create-app-tooltip .create-app-tooltip-js-attribute {
font-family: Raleway-SemiBold;
font-size: 11px;
color: #000000;
bottom: 0;
margin-top: 5px;
}

View file

@ -58,15 +58,15 @@ CreateAppTooltip.prototype = {
if (!TOOLTIP_DEBUG) {
return;
}
tooltipData = {tooltip: 'PLEASE SET THIS TOOLTIP'};
tooltipData = { tooltip: 'PLEASE SET THIS TOOLTIP' };
}
let elementRect = element.getBoundingClientRect();
let elTip = document.createElement("div");
elTip.className = "createAppTooltip";
elTip.className = "create-app-tooltip";
let elTipDescription = document.createElement("div");
elTipDescription.className = "createAppTooltipDescription";
elTipDescription.className = "create-app-tooltip-description";
elTipDescription.innerText = tooltipData.tooltip;
elTip.appendChild(elTipDescription);
@ -77,7 +77,7 @@ CreateAppTooltip.prototype = {
if (!tooltipData.skipJSProperty) {
let elTipJSAttribute = document.createElement("div");
elTipJSAttribute.className = "createAppTooltipJSAttribute";
elTipJSAttribute.className = "create-app-tooltip-js-attribute";
elTipJSAttribute.innerText = `JS Attribute: ${jsAttribute}`;
elTip.appendChild(elTipJSAttribute);
}
@ -93,7 +93,7 @@ CreateAppTooltip.prototype = {
// show above when otherwise out of bounds
elTip.style.top = elementTop - CREATE_APP_TOOLTIP_OFFSET - elTip.clientHeight;
} else {
// show tooltip on below by default
// show tooltip below by default
elTip.style.top = desiredTooltipTop;
}
if ((window.innerWidth + window.pageXOffset) < (desiredTooltipLeft + elTip.clientWidth)) {

View file

@ -3165,8 +3165,13 @@ function loaded() {
} else if (data.type === 'tooltipsReply') {
createAppTooltip.setIsEnabled(!data.hmdActive);
createAppTooltip.setTooltipData(data.tooltips);
} else if (data.type === 'hmdActiveChanged') {
createAppTooltip.setIsEnabled(!data.hmdActive);
}
});
// Request tooltips as soon as we can process a reply:
EventBridge.emitWebEvent(JSON.stringify({ type: 'tooltipsRequest' }));
}
// Server Script Status
@ -3397,6 +3402,5 @@ function loaded() {
setTimeout(function() {
EventBridge.emitWebEvent(JSON.stringify({ type: 'propertiesPageReady' }));
EventBridge.emitWebEvent(JSON.stringify({ type: 'tooltipsRequest' }));
}, 1000);
}