mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
(closes #7040) A few other minor things in this commit - migrated several ui modal files to ES6 syntax - switched the splash link from ideditor.org -> ideditor.blog
56 lines
1.1 KiB
JavaScript
56 lines
1.1 KiB
JavaScript
import { select as d3_select } from 'd3-selection';
|
|
import { uiModal } from './modal';
|
|
|
|
|
|
export function uiLoading(context) {
|
|
let _modalSelection = d3_select(null);
|
|
let _message = '';
|
|
let _blocking = false;
|
|
|
|
|
|
let loading = (selection) => {
|
|
_modalSelection = uiModal(selection, _blocking);
|
|
|
|
let loadertext = _modalSelection.select('.content')
|
|
.classed('loading-modal', true)
|
|
.append('div')
|
|
.attr('class', 'modal-section fillL');
|
|
|
|
loadertext
|
|
.append('img')
|
|
.attr('class', 'loader')
|
|
.attr('src', context.imagePath('loader-white.gif'));
|
|
|
|
loadertext
|
|
.append('h3')
|
|
.text(_message);
|
|
|
|
_modalSelection.select('button.close')
|
|
.attr('class', 'hide');
|
|
|
|
return loading;
|
|
};
|
|
|
|
|
|
loading.message = (val) => {
|
|
if (!arguments.length) return _message;
|
|
_message = val;
|
|
return loading;
|
|
};
|
|
|
|
|
|
loading.blocking = (val) => {
|
|
if (!arguments.length) return _blocking;
|
|
_blocking = val;
|
|
return loading;
|
|
};
|
|
|
|
|
|
loading.close = () => {
|
|
_modalSelection.remove();
|
|
};
|
|
|
|
|
|
return loading;
|
|
}
|