Methods
(inner) location_remove()
The method checks whether a location.infoj has some unsaved changes. A confirm dialog will be shown to confirm the location.remove() without saving changes.
- Source
(inner) onClickEditToggle(e)
The location.editToggle onclick event method toggles location.view edits.
A confirmation is required for entries with newValues.
If cancelled the newValues will removed.
A location.update() will be attempted on confirmation.
An alert will be shown if the location.update() errs.
The location.renderLocationView() will be called on successful update or cancellation.
Name | Type | Description |
---|---|---|
e | Event | The location.editToggle onclick event. |
- Source
(inner) renderLocationView()
The renderLocationView method will remove all location.viewEntries and the .disabled
class from the location.view before recreating the location.viewEntries and appending these to the location.view element.
- Source
(inner) toggleLocationViewEdits(location) → {Boolean}
The toggleLocationViewEdits checks whether the location.layer has the toggleLocationViewEdits flag.
At least one entry of the location must be editable.
New locations must always be editable.
The location.editToggle button element for the location view header is created.
Name | Type | Description |
---|---|---|
location | location | Mapp Location typedef |
- Source
Returns true if toggleLocationViewEdits should be possible.
- Type:
- Boolean
(inner) valChange(e)
The valChange method is assigned to the valChange custom event listener of the location.view element.
An infoj-entry must be provided as detail when the valChange custom event is dispatched.
The valChange method will check whether an entry has a newValue which is different from the current value and assign a class to show the change on the input element.
The valChange event controls the display of the location.update button (.btn-save).
The update button will not be displayed if no entry has a newValue or if some entry is invalid.
Name | Type | Description |
---|---|---|
e | Event | A custom event from the location.view eventlistener. |
Name | Type | Description |
---|---|---|
e.detail | infoj-entry | The detail passed to the valChange event must be an info-entry typedef. |
- Source
(inner) view(location) → {HTMLElement}
The view method creates a location view element group.
Name | Type | Description |
---|---|---|
location | location | A mapp location object. |
- Source
The location.view element.
- Type:
- HTMLElement