Skip to content

Commit

Permalink
refactor: capitalize EventBus in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
koebi authored and TheGreatRefrigerator committed Jan 30, 2023
1 parent 389f39f commit ea161b0
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 56 deletions.
8 changes: 4 additions & 4 deletions src/fragments/box/box.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* @emits resized, [to parent] passing object {maximized: boolean, guid: unique string}
* @emits boxCreated [to parent] passing the box guid
* @listens boxMaximizedStackChanged
* @listens closeBox [global, via eventBus] expecting box guid
* @listens closeBox [global, via eventBus] expecting {guid:<id>, maximized: boolean}
* @listens closeBox [global, via EventBus] expecting box guid
* @listens closeBox [global, via EventBus] expecting {guid:<id>, maximized: boolean}
*/
import theme from '@/config/theme'
import utils from '@/support/utils'
Expand Down Expand Up @@ -91,15 +91,15 @@ export default {
})

// The box component listen to `closeBox` event so that
// it is possible to close a box via eventBus, passing the
// it is possible to close a box via EventBus, passing the
// box guid
EventBus.$on('closeBox', function (boxGuid) {
if (context.guid === boxGuid) {
context.close()
}
})
// The box component listen to `resizeBox` event so that
// it is possible to resize a box via eventBus, passing the
// it is possible to resize a box via EventBus, passing the
// an object containing the boxGuid and maximized boolean property
// like {boxGuid: <the-guid>, maximized: true}
EventBus.$on('resizeBox', function (data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default {
* that will be catch by the map view
* to highlight all sections of a given extra key
* @param {String} extraKey
* @emits highlightPolylineSections (via eventBus)
* @emits highlightPolylineSections (via EventBus)
*/
showAllSections (extraKey) {
const sectionTitle = this.$t('global.' + extraKey).toLowerCase()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default {
/**
* Handle the active route index change
* by emitting a changeActiveRouteIndex
* event via eventBus
* event via EventBus
* @param {*} index
* @emits changeActiveRouteIndex
*/
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/forms/place-input/place-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ export default {
/**
* Search a place by name
* @emits autocompleted
* @emits showLoading [via eventBus]
* @emits showLoading [via EventBus]
*
*/
autocompleteByName () {
Expand Down
4 changes: 2 additions & 2 deletions src/fragments/forms/route-importer/route-importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export default {
},

/**
* Send new map data via eventBus to ors-map
* @emits mapViewDataChanged via eventBus passing fileType and fileContent
* Send new map data via EventBus to ors-map
* @emits mapViewDataChanged via EventBus passing fileType and fileContent
* @param {*} fileType
* @param {*} fileContent
* @param {*} timestamp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Render and deals with left click events
* @emits closed
* @emits showLoading [via eventBus] (when resolving place info)
* @emits showLoading [via EventBus] (when resolving place info)
* @emits directionsToPoint
* @listens mapRightClicked
* @listens mapLeftClicked (to close the right click pop up)
Expand Down Expand Up @@ -106,7 +106,7 @@ export default {
* @param lng
* @param options
* @returns {Promise}
* @emits showLoading (via eventBus)
* @emits showLoading (via EventBus)
*/
resolvePoint (lat, lng) {
return new Promise((resolve, reject) => {
Expand Down
36 changes: 18 additions & 18 deletions src/fragments/map-view/map-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* @uses storage defined in @see /src/store/modules/map-state
*
* Events that this component listens to:
* @listens redrawAndFitMap [via eventBus] - event that will trigger a map redraw and refit bounds - expects {isMaximized: Boolean, guid: String}
* @listens clearMap [via eventBus] - event that will trigger a map clear
* @listens changeActiveRouteIndex [via eventBus] - event that will trigger active route index change
* @listens placeFocusChanged [via eventBus] - updates the map center when a new place is selected *
* Events emitted via eventBus:
* @listens redrawAndFitMap [via EventBus] - event that will trigger a map redraw and refit bounds - expects {isMaximized: Boolean, guid: String}
* @listens clearMap [via EventBus] - event that will trigger a map clear
* @listens changeActiveRouteIndex [via EventBus] - event that will trigger active route index change
* @listens placeFocusChanged [via EventBus] - updates the map center when a new place is selected *
* Events emitted via EventBus:
* @emits activeRouteIndexChanged
* @emits setSideBarStatus
* @emits mapLeftClicked
Expand Down Expand Up @@ -1388,7 +1388,7 @@ export default {
* and emits events that will trigger the displaying
* of the right click floating-context menu
* @param {Object} event
* @emits mapRightClicked (via eventBus)
* @emits mapRightClicked (via EventBus)
*/
mapRightClick (event) {
if (this.showClickPopups) {
Expand All @@ -1412,8 +1412,8 @@ export default {
* and emits events that will trigger the displaying
* of the place info pop up box
* @param {Object} event
* @emits setSidebarStatus (via eventBus)
* @emits mapLeftClicked (via eventBus)
* @emits setSidebarStatus (via EventBus)
* @emits mapLeftClicked (via EventBus)
*/
mapLeftClick (event) {
if (this.$store.getters.pickPlaceIndex !== null) {
Expand Down Expand Up @@ -1972,16 +1972,16 @@ export default {
}
},
/**
* Add map view initial eventBus listeners
* @listens redrawAndFitMap (via eventBus)
* @listens clearMap (via eventBus)
* @listens clearMap (via eventBus)
* @listens placeFocusChanged (via eventBus)
* @listens changeActiveRouteIndex (via eventBus)
* @listens altitudeChartHoverIndexChanged (via eventBus)
* @listens mouseLeftChartAltitudeChart (via eventBus)
* @listens showAltitudeModal (via eventBus)
* @listens highlightPolylineSections (via eventBus)
* Add map view initial EventBus listeners
* @listens redrawAndFitMap (via EventBus)
* @listens clearMap (via EventBus)
* @listens clearMap (via EventBus)
* @listens placeFocusChanged (via EventBus)
* @listens changeActiveRouteIndex (via EventBus)
* @listens altitudeChartHoverIndexChanged (via EventBus)
* @listens mouseLeftChartAltitudeChart (via EventBus)
* @listens showAltitudeModal (via EventBus)
* @listens highlightPolylineSections (via EventBus)
*/
setListeners () {
const context = this
Expand Down
48 changes: 24 additions & 24 deletions src/pages/maps/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export default {
* Set the refreshing search flag as true,
* the searchBtnAvailable flag as false
* and emits the refreshSearch event
* @emits refreshSearch via eventBus
* @emits refreshSearch via EventBus
*/
refreshSearch () {
// the refresh search event will
Expand Down Expand Up @@ -311,9 +311,9 @@ export default {
},
/**
* Save the new map center in mapSettings when it changes
* and emit a mapCenterChanged event via eventBus
* and emit a mapCenterChanged event via EventBus
* @param {*} latlng
* @emits mapCenterChanged [via eventBus]
* @emits mapCenterChanged [via EventBus]
*/
mapCenterChanged (latlng) {
let context = this
Expand Down Expand Up @@ -381,9 +381,9 @@ export default {
this.setViewHeight()
},
/**
* Handle place index selected and emits event via eventBus
* Handle place index selected and emits event via EventBus
* @param {*} index
* @emits placeFocusChanged [via eventBus]
* @emits placeFocusChanged [via EventBus]
*/
placeIndexSelectedInBottomNav (index) {
EventBus.$emit('placeFocusChanged', this.mapViewData.places[index])
Expand Down Expand Up @@ -481,31 +481,31 @@ export default {
},
/**
* When a marker has been dragged
* emits the markerDragged event (via eventBus)
* emits the markerDragged event (via EventBus)
* @param {Object} marker
* @emits markerDragged via eventBus
* @emits markerDragged via EventBus
*/
markerDragged (marker) {
EventBus.$emit('markerDragged', marker)
},

/**
* When a directions from point is hit,
* emit a directionsFromPoint event via eventBus.
* emit a directionsFromPoint event via EventBus.
* The map-view component does not emit events via
* eventBus, only local events to its container (this component)
* EventBus, only local events to its container (this component)
* @param {Object} data
* @emits directionsFromPoint via eventBus
* @emits directionsFromPoint via EventBus
*/
directionsFromPoint (data) {
EventBus.$emit('directionsFromPoint', data)
},
/**
* Trigger directions based on the data passed
* that includes a Place by clearing the map
* and by emitting the directionsToPoint event (via eventBus)
* and by emitting the directionsToPoint event (via EventBus)
* The map-view component does not emit events via
* eventBus, only local events to its container (this component)
* EventBus, only local events to its container (this component)
* @param {Object} data {place: Place}
*/
directionsToPoint (data) {
Expand All @@ -519,7 +519,7 @@ export default {

/**
* Check if the data contains the pick place index
* and emits the setInputPlace via eventBus
* and emits the setInputPlace via EventBus
* @param {*} data
* @emits setInputPlace
*/
Expand All @@ -545,34 +545,34 @@ export default {
},
/**
* When an `add isochrones center` option is hit,
* emits an addAsIsochroneCenter event via eventBus.
* emits an addAsIsochroneCenter event via EventBus.
* The map-view component does not emit events via
* eventBus, only local events to its container (this component)
* EventBus, only local events to its container (this component)
* @param {Object} data
* @emits addAsIsochroneCenter via eventBus
* @emits addAsIsochroneCenter via EventBus
*/
addAsIsochroneCenter (data) {
EventBus.$emit('addAsIsochroneCenter', data)
},

/**
* When an `add route stop` option is hit,
* emits an addRouteStop event via eventBus.
* emits an addRouteStop event via EventBus.
* The map-view component does not emit events via
* eventBus, only local events to its container (this component)
* EventBus, only local events to its container (this component)
* @param {Object} data
* @emits addRouteStop via eventBus
* @emits addRouteStop via EventBus
*/
addRouteStop (data) {
EventBus.$emit('addRouteStop', data)
},
/**
* When an `add destination to route` option is hit,
* emits an addDestinationToRoute event via eventBus.
* emits an addDestinationToRoute event via EventBus.
* The map-view component does not emit events via
* eventBus, only local events to its container (this component)
* EventBus, only local events to its container (this component)
* @param {Object} data
* @emits addDestinationToRoute via eventBus
* @emits addDestinationToRoute via EventBus
*/
addDestinationToRoute (data) {
EventBus.$emit('addDestinationToRoute', data)
Expand Down Expand Up @@ -606,9 +606,9 @@ export default {
/**
* When an avoid polygons option changes,
* merge the avoid polygons array into a multiPolygon and
* emits an avoidPolygonsChanged event via eventBus.
* emits an avoidPolygonsChanged event via EventBus.
* @param {Array} polygons
* @emits avoidPolygonsChanged via eventBus
* @emits avoidPolygonsChanged via EventBus
*/
avoidPolygonsChanged (polygons) {
if (polygons) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/plugin-example/plugin-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*
* It is possible to use values from the store, like, for example:
* store.getters.mapCenter, store.getters.mapBounds and store.getters.mode
* It is also possible to emit events using the eventBus. For example:
* appLoader.getInstance().eventBus.$emit('mapViewDataChanged', mapViewDataChanged)
* It is also possible to emit events using the EventBus. For example:
* EventBus.$emit('mapViewDataChanged', mapViewDataChanged)
*/
class PluginExample {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/support/map-data-services/map-view-data-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class MapViewDataBuilder {
/**
* Build the mapViewData object
* @param {*} data {content:..., options:...}
* @emits mapViewDataChanged - using eventBus
* @emits mapViewDataChanged - using EventBus
*/
static buildMapData = (data, appRouteData) => {
const rawContent = data.content
Expand Down

0 comments on commit ea161b0

Please sign in to comment.