-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#106 redesign statusbar, routingInfo component
- Loading branch information
Mihkel Oviir
committed
May 7, 2020
1 parent
7b9a875
commit 37b19ad
Showing
16 changed files
with
167 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Component from 'Geop/Component' | ||
import { setState, onchange } from 'Utilities/store' | ||
import { clear } from './Routing' | ||
import $ from 'jquery' | ||
import './RoutingInfo.styl' | ||
|
||
class Navigation extends Component { | ||
constructor (target, opts) { | ||
super(target, opts) | ||
this.id = 'routinginfo' | ||
this.el = $(`<span class="text-center d-none"> | ||
<i class="fas fa-location-arrow"></i> | ||
<span></span> | ||
<button class="btn btn-link"> | ||
<i class="fas fa-times"></i> | ||
</button> | ||
</span>`) | ||
this.state = { | ||
active: false, | ||
prev: null | ||
} | ||
this.toggleFn = opts.toggle | ||
this.create() | ||
onchange('routing/info', data => { | ||
if (!this.state.active && data) { | ||
this.activate() | ||
} | ||
if (!data) { | ||
this.deactivate() | ||
} else { | ||
this.el.find('span').html(data) | ||
} | ||
}) | ||
} | ||
render () { | ||
this.el.on('click', 'button', e => { | ||
clear() | ||
setState('routing/stops', []) | ||
setState('routing/info', null) | ||
setState('navigate/to', null) | ||
}) | ||
} | ||
activate (feature) { | ||
this.state.prev = this.toggleFn(this.id) | ||
this.el.removeClass('d-none') | ||
this.state.active = true | ||
} | ||
deactivate () { | ||
this.toggleFn(this.state.prev) | ||
this.el.addClass('d-none') | ||
this.el.find('span').html('') | ||
this.state.active = false | ||
} | ||
} | ||
|
||
export default Navigation |
2 changes: 1 addition & 1 deletion
2
src/geop/components/routing/Navigation.styl → src/geop/components/routing/RoutingInfo.styl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#navigation | ||
#routinginfo | ||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif | ||
color: white | ||
margin-top 6px | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#scale-line .ol-scale-line | ||
#scaleline .ol-scale-line | ||
position: relative | ||
background: transparent | ||
bottom: -8px | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.