mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Move d3curtain to uiCurtain, remove unused event dispatch
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import * as d3 from 'd3';
|
||||
import { utilGetDimensions } from './dimensions';
|
||||
import { utilRebind } from './rebind';
|
||||
import { uiToggle } from '../ui/toggle';
|
||||
import { utilGetDimensions } from '../util/dimensions';
|
||||
import { uiToggle } from './toggle';
|
||||
|
||||
|
||||
// Tooltips and svg mask used to highlight certain features
|
||||
export function d3curtain() {
|
||||
export function uiCurtain() {
|
||||
|
||||
var dispatch = d3.dispatch(),
|
||||
surface = d3.select(null),
|
||||
var surface = d3.select(null),
|
||||
tooltip = d3.select(null),
|
||||
darkness = d3.select(null);
|
||||
|
||||
@@ -145,8 +143,9 @@ export function d3curtain() {
|
||||
curtain.remove = function() {
|
||||
surface.remove();
|
||||
tooltip.remove();
|
||||
d3.select(window).on('resize.curtain', null);
|
||||
};
|
||||
|
||||
|
||||
return utilRebind(curtain, dispatch, 'on');
|
||||
return curtain;
|
||||
}
|
||||
@@ -7,6 +7,7 @@ export { uiCommit } from './commit';
|
||||
export { uiConfirm } from './confirm';
|
||||
export { uiConflicts } from './conflicts';
|
||||
export { uiContributors } from './contributors';
|
||||
export { uiCurtain } from './curtain';
|
||||
export { uiDisclosure } from './disclosure';
|
||||
export { uiEditMenu } from './edit_menu';
|
||||
export { uiEntityEditor } from './entity_editor';
|
||||
|
||||
+13
-14
@@ -1,10 +1,10 @@
|
||||
import * as d3 from 'd3';
|
||||
import { t } from '../../util/locale';
|
||||
import { coreGraph } from '../../core/graph';
|
||||
import { modeBrowse } from '../../modes/index';
|
||||
import { modeBrowse } from '../../modes/browse';
|
||||
import { osmEntity } from '../../osm/entity';
|
||||
import { d3curtain } from '../../util/curtain';
|
||||
import { dataIntroGraph } from '../../../data/intro_graph.json';
|
||||
import { uiCurtain } from '../curtain';
|
||||
|
||||
import { uiIntroNavigation } from './navigation';
|
||||
import { uiIntroPoint } from './point';
|
||||
@@ -104,25 +104,14 @@ export function uiIntro(context) {
|
||||
// Load semi-real data used in intro
|
||||
context.connection().toggle(false).reset();
|
||||
context.history().reset();
|
||||
|
||||
context.history().merge(d3.values(coreGraph().load(introGraph).entities));
|
||||
context.background().bing();
|
||||
|
||||
d3.selectAll('#map .layer-background').style('opacity', 1);
|
||||
|
||||
var curtain = d3curtain();
|
||||
var curtain = uiCurtain();
|
||||
selection.call(curtain);
|
||||
|
||||
|
||||
function reveal(box, text, options) {
|
||||
options = options || {};
|
||||
curtain.reveal(box,
|
||||
text || '',
|
||||
options.tooltipClass || '',
|
||||
options.duration
|
||||
);
|
||||
}
|
||||
|
||||
var steps = ['navigation', 'point', 'area', 'line', 'startEditing'].map(function(step, i) {
|
||||
var s = sampleIntros[step](context, reveal)
|
||||
.on('done', function() {
|
||||
@@ -175,6 +164,16 @@ export function uiIntro(context) {
|
||||
enter(steps[0]);
|
||||
|
||||
|
||||
function reveal(box, text, options) {
|
||||
options = options || {};
|
||||
curtain.reveal(box,
|
||||
text || '',
|
||||
options.tooltipClass || '',
|
||||
options.duration
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function enter(newStep) {
|
||||
if (step) { step.exit(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user