mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-05 19:01:30 +00:00
Change raw tag editor readOnlyTags to accept array of regex
This commit is contained in:
@@ -12,11 +12,11 @@ import { utilRebind } from '../util';
|
||||
|
||||
var changeset;
|
||||
var readOnlyTags = [
|
||||
'changesets_count',
|
||||
'created_by',
|
||||
'imagery_used',
|
||||
'host',
|
||||
'locale'
|
||||
/^changesets_count$/,
|
||||
/^created_by$/,
|
||||
/^imagery_used$/,
|
||||
/^host$/,
|
||||
/^locale$/
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -175,7 +175,12 @@ export function uiRawTagEditor(context) {
|
||||
|
||||
|
||||
function isReadOnly(d) {
|
||||
return readOnlyTags.indexOf(d.key) !== -1;
|
||||
for (var i = 0; i < readOnlyTags.length; i++) {
|
||||
if (d.key.match(readOnlyTags[i]) !== null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user