Skip to content

Commit

Permalink
#425 Description Item fixes (#426)
Browse files Browse the repository at this point in the history
* #425 Description Item fixes

* Remove outdated comment
  • Loading branch information
tariqksoliman authored Sep 8, 2023
1 parent d7dfce4 commit 50472e1
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 7 deletions.
13 changes: 13 additions & 0 deletions src/css/mmgisUI.css
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,19 @@
background-color: var(--color-a2);
}

.hideScrollbar::-webkit-scrollbar-track {
background-color: Transparent;
}

.hideScrollbar::-webkit-scrollbar {
width: 0px;
height: 0px;
}

.hideScrollbar::-webkit-scrollbar-thumb {
border-radius: 0px;
}

::-webkit-scrollbar {
width: 14px;
height: 14px;
Expand Down
15 changes: 10 additions & 5 deletions src/essence/Ancillary/Description.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,23 @@ const Description = {
this.inited = true
if (this.waitingOnUpdate) this.updateInfo()
},
updateInfo() {
this.waitingOnUpdate = false
if (!this.inited) {
this.waitingOnUpdate = true
return
updateInfo(force) {
if (force !== true) {
this.waitingOnUpdate = false
if (!this.inited) {
this.waitingOnUpdate = true
return
}
}

this.descInfoCont.html('')

let infos = []

for (let layer in this.L_.layers.data) {
let l = this.L_.layers.data[layer]
if (
this.L_.layers.on[layer] === true &&
this.L_.layers.layer[layer] &&
l.hasOwnProperty('variables') &&
l.variables.hasOwnProperty('info') &&
Expand Down
8 changes: 8 additions & 0 deletions src/essence/Basics/Layers_/Layers_.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ const L_ = {
Object.keys(L_._onLayerToggleSubscriptions).forEach((k) => {
L_._onLayerToggleSubscriptions[k](s.name, !on)
})

// Always reupdate layer infos at the end to keep them in sync
Description.updateInfo()

// Deselect active feature if its layer is being turned off
if (L_.activeFeature && L_.activeFeature.layerName === s.name && on) {
L_.setActiveFeature(null)
}
},
toggleLayerHelper: async function (
s,
Expand Down
11 changes: 10 additions & 1 deletion src/essence/Basics/UserInterface_/UserInterface_.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,20 @@
pointer-events: auto;
}

#main-container > #topBar > #topBarLeft {
flex: 1;
pointer-events: none;
overflow-x: auto;
overflow-y: hidden;
margin-right: 8px;
}
#main-container > #topBar > #topBarLeft,
#main-container > #topBar > #topBarRight {
display: flex;
}

#main-container > #topBar #topBarSecondary {
flex: 1;
}
#main-container > #topBar #topBarMain,
#main-container > #topBar #topBarSecondary {
display: flex;
Expand Down
7 changes: 6 additions & 1 deletion src/essence/Basics/UserInterface_/UserInterface_.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var UserInterface = {
// prettier-ignore
const topBarMarkup = [
"<div id='topBar'>",
"<div id='topBarLeft'>",
"<div id='topBarLeft' class='hideScrollbar'>",
"<div id='topBarMain'>",
"<div id='topBarTitle'>",
`<div id='topBarTitleName' tabindex='200'>`,
Expand All @@ -84,6 +84,11 @@ var UserInterface = {
//TopBar
$('#main-container').append(topBarMarkup)

$('#topBarLeft').on('wheel', function (e) {
e.preventDefault()
this.scrollLeft += e.originalEvent.deltaY
})

this.rightPanel = d3
.select('body')
.append('div')
Expand Down

0 comments on commit 50472e1

Please sign in to comment.