silverstripe-mapboxfield/client/src/bundles/bundle.js

23 lines
465 B
JavaScript

import jQuery from 'jquery';
import MapboxField from 'components/MapboxField/MapboxField';
jQuery.entwine('ss', ($) => {
$('.cms-edit-form .mapbox').entwine({
MapboxField: null,
onmatch() {
if (!this.getMapboxField()) {
this.setMapboxField(new MapboxField(this));
}
}
});
$('.cms-edit-form [aria-hidden="false"] .mapbox').entwine({
onmatch() {
this._super();
this.getMapboxField().render();
}
});
});