mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-31 01:09:22 +02:00
z-sort errors above warnings
This commit is contained in:
@@ -328,6 +328,7 @@ export default {
|
||||
|
||||
// try to handle error type directly, fallback to parent error type.
|
||||
var whichType = errorTemplate ? errorType : parentErrorType;
|
||||
var whichTemplate = errorTypes[whichType];
|
||||
|
||||
// Rewrite a few of the errors at this point..
|
||||
// This is done to make them easier to linkify and translate.
|
||||
@@ -376,6 +377,7 @@ export default {
|
||||
which_type: whichType,
|
||||
error_type: errorType,
|
||||
parent_error_type: parentErrorType,
|
||||
severity: whichTemplate.severity || 'error',
|
||||
object_id: props.object_id,
|
||||
object_type: props.object_type,
|
||||
schema: props.schema,
|
||||
|
||||
@@ -175,7 +175,11 @@ export function svgKeepRight(projection, context, dispatch) {
|
||||
|
||||
|
||||
function sortY(a, b) {
|
||||
return (a.id === selectedID) ? 1 : (b.id === selectedID) ? -1 : b.loc[1] - a.loc[1];
|
||||
return (a.id === selectedID) ? 1
|
||||
: (b.id === selectedID) ? -1
|
||||
: (a.severity === 'error' && b.severity !== 'error') ? 1
|
||||
: (b.severity === 'error' && a.severity !== 'error') ? -1
|
||||
: b.loc[1] - a.loc[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user