fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix meta editor for ns-less tags.
[redakcja.git]
/
src
/
redakcja
/
static
/
js
/
wiki
/
view_properties.js
diff --git
a/src/redakcja/static/js/wiki/view_properties.js
b/src/redakcja/static/js/wiki/view_properties.js
index
eeddf67
..
a7caf10
100644
(file)
--- a/
src/redakcja/static/js/wiki/view_properties.js
+++ b/
src/redakcja/static/js/wiki/view_properties.js
@@
-266,13
+266,24
@@
// clear container
$('.c', $fg).empty();
// clear container
$('.c', $fg).empty();
-
- $("> [x-node='RDF'] > [x-node='Description'] > [x-node='"+tag+"'][x-ns='"+ns+"']", self.$edited).each(function() {
+
+ let selector = "> [x-node='RDF'] > [x-node='Description'] > [x-node='"+tag+"']";
+ if (ns) {
+ selector += "[x-ns='"+ns+"']";
+ }
+ $(selector, self.$edited).each(function() {
self.addMetaInput(
$('.c', $fg),
field,
this);
});
self.addMetaInput(
$('.c', $fg),
field,
this);
});
+
+ count = $('.c > .input-group', $fg).length;
+ if (field.required) {
+ if (!count) {
+ $('<div class="text-warning">WYMAGANE</div>').appendTo($('.c', $fg));
+ }
+ }
};
};