mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:23:06 +02:00
Fix edit toolbar's upload button
This commit is contained in:
parent
62b24e6626
commit
ebe13b7b93
1 changed files with 6 additions and 25 deletions
|
@ -411,7 +411,6 @@ var toolBar = (function() {
|
||||||
return entityID;
|
return entityID;
|
||||||
}
|
}
|
||||||
|
|
||||||
var newModelButtonDown = false;
|
|
||||||
that.mousePressEvent = function(event) {
|
that.mousePressEvent = function(event) {
|
||||||
var clickedOverlay,
|
var clickedOverlay,
|
||||||
url,
|
url,
|
||||||
|
@ -432,14 +431,14 @@ var toolBar = (function() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle these two buttons in the mouseRelease event handler so that we don't suppress a mouseRelease event from
|
|
||||||
// occurring when showing a modal dialog.
|
|
||||||
if (newModelButton === toolBar.clicked(clickedOverlay)) {
|
if (newModelButton === toolBar.clicked(clickedOverlay)) {
|
||||||
newModelButtonDown = true;
|
url = Window.prompt("Model URL", modelURLs[Math.floor(Math.random() * modelURLs.length)]);
|
||||||
|
if (url !== null && url !== "") {
|
||||||
|
addModel(url);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (newCubeButton === toolBar.clicked(clickedOverlay)) {
|
if (newCubeButton === toolBar.clicked(clickedOverlay)) {
|
||||||
createNewEntity({
|
createNewEntity({
|
||||||
type: "Box",
|
type: "Box",
|
||||||
|
@ -560,26 +559,8 @@ var toolBar = (function() {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
that.mouseReleaseEvent = function(event) {
|
that.mouseReleaseEvent = function (event) {
|
||||||
var handled = false;
|
return false;
|
||||||
if (newModelButtonDown) {
|
|
||||||
var clickedOverlay = Overlays.getOverlayAtPoint({
|
|
||||||
x: event.x,
|
|
||||||
y: event.y
|
|
||||||
});
|
|
||||||
if (newModelButton === toolBar.clicked(clickedOverlay)) {
|
|
||||||
url = Window.prompt("Model URL", modelURLs[Math.floor(Math.random() * modelURLs.length)]);
|
|
||||||
if (url !== null && url !== "") {
|
|
||||||
addModel(url);
|
|
||||||
}
|
|
||||||
handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
newModelButtonDown = false;
|
|
||||||
|
|
||||||
|
|
||||||
return handled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Window.domainChanged.connect(function() {
|
Window.domainChanged.connect(function() {
|
||||||
|
|
Loading…
Reference in a new issue