Mesh highlight with multiselection.

This commit is contained in:
kovacsv 2019-01-11 08:59:28 +01:00
parent 1d538ec6ef
commit 2503893967
2 changed files with 23 additions and 15 deletions

View File

@ -119,7 +119,8 @@ div.extbutton img
div.menuitem
{
padding : 2px;
padding : 1px 3px;
margin-bottom : 2px;
text-overflow : ellipsis;
white-space : nowrap;
overflow : hidden;
@ -128,7 +129,7 @@ div.menuitem
div.menuitem.highlighted
{
background : #95cae4;
padding : 1px;
padding : 0px 2px;
border : 1px solid #008ab8;
}
@ -147,7 +148,7 @@ div.menutext
img.menubutton
{
padding : 2px;
padding : 1px;
float : left;
cursor : pointer;
border : 0px;

View File

@ -546,21 +546,28 @@ ImporterApp.prototype.HighlightMesh = function (meshIndex)
}
var i, menuItem, highlight;
for (i = 0; i < this.meshMenuItems.length; i++) {
menuItem = this.meshMenuItems[i];
highlight = false;
if (i == meshIndex) {
if (!menuItem.IsHighlighted ()) {
menuItem.Highlight (true);
menuItem.menuItemDiv.get (0).scrollIntoView ();
HighlightMeshInModel (this.viewer, i, true);
} else {
if (meshIndex != -1) {
for (i = 0; i < this.meshMenuItems.length; i++) {
menuItem = this.meshMenuItems[i];
highlight = false;
if (i == meshIndex) {
if (!menuItem.IsHighlighted ()) {
menuItem.Highlight (true);
menuItem.menuItemDiv.get (0).scrollIntoView ();
HighlightMeshInModel (this.viewer, i, true);
} else {
menuItem.Highlight (false);
HighlightMeshInModel (this.viewer, i, false);
}
}
}
} else {
for (i = 0; i < this.meshMenuItems.length; i++) {
menuItem = this.meshMenuItems[i];
if (menuItem.IsHighlighted ()) {
menuItem.Highlight (false);
HighlightMeshInModel (this.viewer, i, false);
}
} else if (menuItem.IsHighlighted ()) {
menuItem.Highlight (false);
HighlightMeshInModel (this.viewer, i, false);
}
}
};