cleaned up merge relics and comments

This commit is contained in:
Thomas Hervey
2018-07-20 23:31:49 -04:00
parent a6bdbcabb2
commit 06a410107b
8 changed files with 2 additions and 73 deletions

View File

@@ -69,7 +69,6 @@ export function behaviorDrag() {
function dragstart() {
console.log('TAH - drag start');
_target = this;
_event = eventOf(_target, arguments);
@@ -129,7 +128,6 @@ export function behaviorDrag() {
function dragend() {
console.log('TAH - drag end');
if (started) {
_event({ type: 'end' });
@@ -157,7 +155,6 @@ export function behaviorDrag() {
function drag(selection) {
console.log('TAH - drag: ', selection);
var matchesSelector = utilPrefixDOMProperty('matchesSelector');
var delegate = dragstart;
@@ -168,16 +165,8 @@ export function behaviorDrag() {
for (; target && target !== root; target = target.parentNode) {
var datum = target.__data__;
<<<<<<< HEAD
var entity;
if (datum instanceof osmNote) { entity = datum;}
else {
entity = datum && datum.properties && datum.properties.entity;
}
=======
var entity = datum instanceof osmNote ?
datum : datum && datum.properties && datum.properties.entity;
>>>>>>> drag-note
if (entity && target[matchesSelector](_selector)) {
return dragstart.call(target, entity);

View File

@@ -136,7 +136,6 @@ export function modeDragNote2(context) {
drag.target(vertex.node(), entity);
} else {
console.log('else');
context.perform(actionNoop());
}
@@ -423,7 +422,6 @@ export function modeDragNote2(context) {
mode.enter = function() {
console.log('TAH - mode.drag_note2 entered');
context.install(hover);
context.install(edit);
@@ -437,7 +435,6 @@ export function modeDragNote2(context) {
mode.exit = function() {
console.log('TAH - mode.drag_note2 exited');
context.ui().sidebar.hover.cancel();
context.uninstall(hover);
context.uninstall(edit);
@@ -466,7 +463,6 @@ export function modeDragNote2(context) {
mode.selectedIDs = function() {
console.log('TAH - mode.selectedIDs');
if (!arguments.length) return _activeEntity ? [_activeEntity.id] : [];
// no assign
return mode;
@@ -474,7 +470,6 @@ export function modeDragNote2(context) {
mode.activeID = function() {
console.log('TAH - mode.selectedIDs');
if (!arguments.length) return _activeEntity && _activeEntity.id;
// no assign
return mode;
@@ -482,7 +477,6 @@ export function modeDragNote2(context) {
mode.restoreSelectedIDs = function(_) {
console.log('TAH - mode.restoreSelectedIDs');
if (!arguments.length) return _restoreSelectedIDs;
_restoreSelectedIDs = _;
return mode;

View File

@@ -8,18 +8,13 @@ import { d3keybinding as d3_keybinding } from '../lib/d3.keybinding.js';
import {
behaviorHover,
behaviorLasso,
behaviorSelect,
behaviorDrag
behaviorSelect
} from '../behavior';
<<<<<<< HEAD
=======
import { modeDragNote } from '../modes';
>>>>>>> drag-note
import { services } from '../services';
import { modeBrowse } from './browse';
import { modeDragNote } from './drag_note';
import { uiNoteEditor } from '../ui';
@@ -44,11 +39,7 @@ export function modeSelectNote(context, selectedNoteID) {
behaviorHover(context),
behaviorSelect(context),
behaviorLasso(context),
<<<<<<< HEAD
// modeDragNote(context).restoreSelectedNoteIDs(selectedNoteID).behavior TAH - re-add
=======
modeDragNote(context).behavior
>>>>>>> drag-note
];
var newFeature = false;

View File

@@ -1,6 +1,4 @@
/* global Mapillary:false */
import _filter from 'lodash-es/filter';
import _find from 'lodash-es/find';
import _flatten from 'lodash-es/flatten';
import _forEach from 'lodash-es/forEach';
import _isEmpty from 'lodash-es/isEmpty';
@@ -44,18 +42,6 @@ function abortRequest(i) {
}
function nearNullIsland(x, y, z) {
if (z >= 7) {
var center = Math.pow(2, z - 1);
var width = Math.pow(2, z - 6);
var min = center - (width / 2);
var max = center + (width / 2) - 1;
return x >= min && x <= max && y >= min && y <= max;
}
return false;
}
function maxPageAtZoom(z) {
if (z < 15) return 2;
if (z === 15) return 5;
@@ -66,20 +52,6 @@ function maxPageAtZoom(z) {
}
function localeTimestamp(s) {
if (!s) return null;
var detected = utilDetect();
var options = {
day: 'numeric', month: 'short', year: 'numeric',
hour: 'numeric', minute: 'numeric', second: 'numeric',
timeZone: 'UTC'
};
var d = new Date(s);
if (isNaN(d.getTime())) return null;
return d.toLocaleString(detected.locale, options);
}
function loadTiles(which, url, projection) {
var s = projection.scale() * 2 * Math.PI;
var currZoom = Math.floor(Math.max(Math.log(s) / Math.log(2) - 8, 0));

View File

@@ -1,5 +1,3 @@
import _filter from 'lodash-es/filter';
import _find from 'lodash-es/find';
import _flatten from 'lodash-es/flatten';
import _forEach from 'lodash-es/forEach';
import _map from 'lodash-es/map';
@@ -53,18 +51,6 @@ function abortRequest(i) {
}
function nearNullIsland(x, y, z) {
if (z >= 7) {
var center = Math.pow(2, z - 1),
width = Math.pow(2, z - 6),
min = center - (width / 2),
max = center + (width / 2) - 1;
return x >= min && x <= max && y >= min && y <= max;
}
return false;
}
function maxPageAtZoom(z) {
if (z < 15) return 2;
if (z === 15) return 5;

View File

@@ -2,8 +2,6 @@ import _chunk from 'lodash-es/chunk';
import _cloneDeep from 'lodash-es/cloneDeep';
import _extend from 'lodash-es/extend';
import _forEach from 'lodash-es/forEach';
import _filter from 'lodash-es/filter';
import _find from 'lodash-es/find';
import _groupBy from 'lodash-es/groupBy';
import _isEmpty from 'lodash-es/isEmpty';
import _map from 'lodash-es/map';

View File

@@ -16,7 +16,6 @@ import {
import { svgIcon } from '../svg';
import { tooltip } from '../util/tooltip';
import { uiTooltipHtml } from './tooltipHtml';
import { services } from '../services/index.js';
export function uiModes(context) {

View File

@@ -55,7 +55,7 @@ export function uiNoteHeader() {
}
noteHeader.note = function(_, __) {
noteHeader.note = function(_) {
if (!arguments.length) return _note;
_note = _;
return noteHeader;