mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Enhance showInputOptionsForKey for multiple keys
This commit is contained in:
parent
3b843c0d23
commit
33c568c12e
@ -1145,10 +1145,22 @@ function showInputOptions(path, elements, state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showInputOptionsForKey(editor, item, showForKey, state) {
|
function showInputOptionsForKey(editor, item, showForKeys, state) {
|
||||||
var elements = [];
|
var elements = [];
|
||||||
|
var keysToshow = [];
|
||||||
|
|
||||||
|
if (Array.isArray(showForKeys)) {
|
||||||
|
keysToshow = showForKeys;
|
||||||
|
} else {
|
||||||
|
if (typeof showForKeys === 'string') {
|
||||||
|
keysToshow.push(showForKeys);
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (var key in editor.schema.properties[item].properties) {
|
for (var key in editor.schema.properties[item].properties) {
|
||||||
if (showForKey !== key) {
|
if ($.inArray(key, keysToshow) === -1) {
|
||||||
var accessLevel = editor.schema.properties[item].properties[key].access;
|
var accessLevel = editor.schema.properties[item].properties[key].access;
|
||||||
|
|
||||||
//Always disable all elements, but only enable elements, if access level compliant
|
//Always disable all elements, but only enable elements, if access level compliant
|
||||||
|
Loading…
x
Reference in New Issue
Block a user