Change raw tag editor readOnlyTags to accept array of regex

This commit is contained in:
Bryan Housel
2017-08-16 19:54:53 -04:00
parent 25d8a8aa08
commit ea298b0b18
2 changed files with 11 additions and 6 deletions

View File

@@ -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$/
];

View File

@@ -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;
}