mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +02:00
chore: remove DomUtil.after/before
This commit is contained in:
parent
60ac4b35f2
commit
7991d6cdbe
2 changed files with 7 additions and 18 deletions
|
@ -7,6 +7,7 @@ import {
|
|||
import { translate } from './i18n.js'
|
||||
import { Request, ServerRequest } from './request.js'
|
||||
import { escapeHTML, generateId } from './utils.js'
|
||||
import * as Utils from './utils.js'
|
||||
|
||||
export class BaseAutocomplete {
|
||||
constructor(parent, options) {
|
||||
|
@ -291,10 +292,9 @@ class BaseServerAjax extends BaseAjax {
|
|||
export const SingleMixin = (Base) =>
|
||||
class extends Base {
|
||||
initSelectedContainer() {
|
||||
return DomUtil.after(
|
||||
this.input,
|
||||
DomUtil.element({ tagName: 'div', className: 'umap-singleresult' })
|
||||
)
|
||||
const el = Utils.loadTemplate('<div class="umap-singleresult"></div>')
|
||||
this.input.parentNode.insertBefore(el, this.input.nextSibling)
|
||||
return el
|
||||
}
|
||||
|
||||
displaySelected(result) {
|
||||
|
@ -322,10 +322,9 @@ export const SingleMixin = (Base) =>
|
|||
export const MultipleMixin = (Base) =>
|
||||
class extends Base {
|
||||
initSelectedContainer() {
|
||||
return DomUtil.after(
|
||||
this.input,
|
||||
DomUtil.element({ tagName: 'ul', className: 'umap-multiresult' })
|
||||
)
|
||||
const el = Utils.loadTemplate('<ul class="umap-multiresult"></ul>')
|
||||
this.input.parentNode.insertBefore(el, this.input.nextSibling)
|
||||
return el
|
||||
}
|
||||
|
||||
displaySelected(result) {
|
||||
|
|
|
@ -128,16 +128,6 @@ L.DomUtil.element = ({ tagName, parent, ...attrs }) => {
|
|||
return el
|
||||
}
|
||||
|
||||
L.DomUtil.before = (target, el) => {
|
||||
target.parentNode.insertBefore(el, target)
|
||||
return el
|
||||
}
|
||||
|
||||
L.DomUtil.after = (target, el) => {
|
||||
target.parentNode.insertBefore(el, target.nextSibling)
|
||||
return el
|
||||
}
|
||||
|
||||
// From https://gist.github.com/Accudio/b9cb16e0e3df858cef0d31e38f1fe46f
|
||||
// convert colour in range 0-255 to the modifier used within luminance calculation
|
||||
L.DomUtil.colourMod = (colour) => {
|
||||
|
|
Loading…
Reference in a new issue