Commit Graph

88 Commits

Author SHA1 Message Date
Bryan Housel 57ba6a9862 Add selectedIDs() for modeMove and modeRotate
This allows the label collision boxes for the vertices to update
during these modes. Otherwise the labels.js `isInterestingVertex()`
function doesn't consider them interesting enough to update.
2017-12-18 00:11:08 -05:00
Bryan Housel aa68b21d7a Add touch targets for line/area 2017-12-17 22:53:58 -05:00
Bryan Housel 5a4faa84a1 Fixed some of the point/vertex/midpoint snapping issues
Still working on snapping to lines/areas, and making sure drawing lines/areas
will complete
2017-12-16 01:33:12 -05:00
Bryan Housel 5cb5456869 Implement touch targets for midpoints and points 2017-12-15 22:50:55 -05:00
Bryan Housel ba7437b4cc Fix order of vertex in _assign, always get latest entity
(selected or hovered entities are old, if we're moving vertices around)
2017-12-15 21:21:48 -05:00
Bryan Housel 89d8d37576 Drawing all the correct vertices now where I want them, simplify classes
Some highlights
- `getSiblingAndChildVertices` are expensive, so they're saved and called less frequently
- draw touch targets for all the visible vertices
- remove redundant css classes and `setClass` function
2017-12-15 17:28:20 -05:00
Bryan Housel 899abc7ef5 WIP to render vertices while dragging
(re: #3003 / #4602)

For now, drawHover is commented out.  Still not sure what I will do with it.
This means that things flicker a bit when dragging, also connecting nodes
(and closing lines) does not currently work.

There was lot going on preventing the vertices from rendering while dragging.

1. `modeDragNode` needed a proper `selectedIDs()` function that works like other
modes.. Many other places in iD (including the vertex renderer) call `context.selectedIDs()`..
This means that `modeDragNode` needs a new function `restoreSelectedIDs()` to do what
`selectedIDs()` was previously doing (a place to store selectedIDs so that we
can reselect those entities after the user is done dragging a node in select mode)

2. Just so many things in svg/vertices.js
  - siblingAndChildVertices was missing some things for points that we render
    as vertices (points in wireframe, points with directions)
  - the sibling vertices weren't being included in the `filter` function, so
    would disappear when doing differenced/extent redraws
  - probably some other things
2017-12-12 17:39:36 -05:00
Bryan Housel c6ab9e593d Flash message if drag not allowed because of a hidden connection
(closes #4493)
2017-12-06 00:11:42 -05:00
Bryan Housel 35a9f77a63 Preserve selected entity when cancelling save mode
(closes #4407)
2017-11-12 12:34:04 -05:00
Bryan Housel 914ef0236a Convert lodah-es and d3 to named imports for modes 2017-09-24 23:25:49 -04:00
Bryan Housel a43b1e3c0a WIP: fix download changes on save conflicts screen 2017-09-14 22:25:17 -04:00
Bryan Housel 8c9aae1499 Add download changes link to uiCommitChanges summary
(WIP: still need to check IE11 and fix download on conflict screen)
2017-09-14 17:35:06 -04:00
Bryan Housel 5ffa8f535e Relax the availability rules for rotation and reflection operations
(closes #4237)

New rules:
- Rotation available if at least 2 unique nodes in selectedIDs
- Reflection available if at least 3 unique nodes in selectedIDs
2017-08-17 14:32:32 -04:00
Bryan Housel c56dc5afc3 In save mode, escape should cancel and return to browse mode
(closes #4230)
2017-08-15 14:32:16 -04:00
Bryan Housel 99a3741b0c Better isolation of services, to avoid hitting network during test runs
1. All services are disabled in testing now to prevent network accesses
2. Only services are enabled when needed to test something
3. Many changes throughout code to allow iD to run with services disabled
   (e.g. check for osm service instead of assuming context.connection() will work)
4. Actually export the services so we can disable and enable them
2017-08-09 22:04:09 -04:00
Bryan Housel d20e053057 Add missing vertex navigation keys '{' and '}' 2017-06-09 12:46:40 -04:00
Bryan Housel 651ec363f6 Undo/Redo while drawing line/area should keep the user in drawing mode
(closes #3530)
2017-05-03 16:08:23 -04:00
Bryan Housel 49c087d51f Rename delegate->selector, adjust formatting, drop userselect polyfill 2017-04-25 16:51:12 -04:00
Bryan Housel e6da524f82 Allow all nodes and vertices to be dragged
(revert of #3739)
2017-04-25 16:44:09 -04:00
Bryan Housel d441cd92c3 Smaller nudge regions in drag_node and move
(closes #3956)
2017-04-20 22:18:33 -04:00
Bryan Housel d7728691d4 Allow user to hit escape to leave select mode in walkthrough 2017-03-31 15:04:54 -04:00
Bryan Housel 85ed3cc2d3 Cleanup line drawing code with selected sort 2017-03-21 12:42:46 -04:00
Bryan Housel 4903d495b7 Draw selected items last, so halos are more visible
(see #2914)
2017-03-21 02:17:04 -04:00
Bryan Housel 1a8cfcc8b1 Changeset refactor
(closes #2633)

* move osmChangeJXON from osm service to osmChangeset
* cleanup putChangeset for code clarity
* adjust params for callbacks (pass changeset around instead of changeset_id)
* add commit.reset() to reset changeset object after successful save
* improve checks for changeset tags (trim whitespace, etc)
2017-03-15 11:03:43 -04:00
Bryan Housel 16df2f595f Change raw tag editor to embed it on commit pane 2017-03-13 17:32:50 -04:00
Bryan Housel 814a2eb887 Guard code around geoPointInPolygon
(closes #3876)
2017-03-04 00:24:36 -05:00
Bryan Housel 014b580a44 Force inspector to recreate all of its content after a save
(closes #3844)
2017-03-03 01:37:32 -05:00
Bryan Housel cfb8826290 Position menu when toggling with spacebar
(closes #3862)
2017-02-28 15:02:06 -05:00
Bryan Housel f7c3de9545 Preserve backward compability with radial menu
Old menu behavior can be restored with 2 cookies:
- `edit-menu-style=radial` - Display menu as a radial menu, limited to 8 items
- `edit-menu-show-always=1` - Show menu on all clicks, not just contextmenu/right
2017-02-22 16:50:42 -05:00
Bryan Housel 4f8d772397 More improvements to select behavior re contextmenu, shiftclick, etc. 2017-02-21 22:16:17 -05:00
Bryan Housel e756520bd8 suppressMenu(true) is now the default 2017-02-21 15:47:22 -05:00
Bryan Housel d8237fa3eb Variable names, fix edge avoidance, tooltips placement, RTL 2017-02-18 15:42:54 -05:00
Kushan Joshi ca25a34987 semver compliance for edit_menu 2017-02-09 13:03:12 +05:30
Kushan Joshi 11d7cc7b34 white theme for edit_menu.js 2017-02-09 12:53:10 +05:30
Kushan Joshi 5b92b90ced Add context menu 2017-02-09 12:53:10 +05:30
Bryan Housel 86118ece4e Fix node drag regression introduced in 919234d
(closes #3829)
2017-02-07 11:40:11 -05:00
Bryan Housel 919234d2df Make sure to select vertex-persistent when looking for siblings
(closes #3824)

When hovering, there is also a companion `vertex-hover` element that might
sometimes get selected, and doesn't have the sibling class that enables drag.
2017-02-06 16:43:54 -05:00
Bryan Housel bc1193c347 Make sure nodes can be dragged too, not just vertices
(fixes bug introduced in 0440054)
2017-01-29 17:23:34 -05:00
Bryan Housel f93e57b97d Use #map.node() for drag surface instead of svg #surface
This is because #surface can be transformed during a partial redraw
and d3.mouse() returns transformed point, not the real screen point.
https://github.com/d3/d3-selection/blob/a2cf4f32ec2a88196c9f992e34ec23aec589f797/src/point.js#L4-L9
2017-01-29 17:11:55 -05:00
Bryan Housel 31dcabc8f8 Actually move the dragged point while nudging 2017-01-29 17:01:36 -05:00
Bryan Housel 6c062fb312 WIP: improve edge to support diagonal nudges, redraws on nudge
(working on #3594 today)
2017-01-28 15:51:23 -05:00
Bryan Housel 0440054cd9 Child and sibling vertices should be eligible for drag_node
(closes #3799, see also #3801)
2017-01-27 13:02:27 -05:00
popov ad06e341ad do not use tabs 2017-01-27 09:54:08 -05:00
popov 56dbebd0b6 fix array concat 2017-01-27 09:54:01 -05:00
popov a2f9f51ee6 Allow to drag a node when a parent relation is selected 2017-01-27 09:53:52 -05:00
Bryan Housel 6b62f40eb6 Improve save flow
(see #3777)

* When entering Save mode, map content transitions inactive: appears grayscale
and dims slightly so colorblind users perceive a change. The sidebar controls
still let the user review their edits, or return to editing to address any
warnings.
* Adjusted the language a little bit "Save" -> "Upload" to make it clear that
an Upload needs to happen. No more 2 Save buttons.
2017-01-24 12:21:05 -05:00
Bryan Housel 3246ca176f Eagerly load user's details and changesets
(closes #3787)

Also, don't redo authentication in save.js if user is already authenticated
2017-01-22 12:43:39 -05:00
Bryan Housel 0fb506f461 Make sure new midpoint also gets included in activeIDs 2017-01-16 20:37:34 +05:30
Bryan Housel aff9cc3b13 Merge branch 'drag-node-behavior' of https://github.com/edpop/iD into edpop-drag-node-behavior 2017-01-16 19:32:47 +05:30
Bryan Housel 45b7a40557 Fix area drawing for #3676
These changes are needed now that `addNode`
* wants to preserve circularity
* automatically remove duplicates
* range checks index argument (can't call it with -1 anymore)
2017-01-12 19:30:07 +05:30