Merge remote-tracking branch 'origin/master' into merge_master
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -16,11 +16,16 @@ class DocumentMetadataForm(forms.Form):
|
||||
label=_('Name'), required=False,
|
||||
widget=forms.TextInput(attrs={'readonly': 'readonly'})
|
||||
)
|
||||
value = forms.CharField(label=_('Value'), required=False)
|
||||
value = forms.CharField(label=_('Value'), required=False,
|
||||
widget=forms.TextInput(attrs={'class': 'metadata-value'})
|
||||
)
|
||||
update = forms.BooleanField(
|
||||
initial=True, label=_('Update'), required=False
|
||||
)
|
||||
|
||||
class Media:
|
||||
js = ('metadata/js/metadata_form.js',)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(DocumentMetadataForm, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
11
mayan/apps/metadata/static/metadata/js/metadata_form.js
Normal file
11
mayan/apps/metadata/static/metadata/js/metadata_form.js
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
waitForJQuery(function() {
|
||||
jQuery(document).ready(function() {
|
||||
$('.metadata-value').on('input', function(event) {
|
||||
// Check the checkbox next to a metadata value input when there is
|
||||
// data entry in the value's input.
|
||||
$(event.target).parents('tr').find(':checkbox').prop('checked', true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user