Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cds_deposit: Use apply on ckeditor readonly for immediate update #1986

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cds/modules/invenio_deposit/views/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def new():
deposit_type = request.values.get("type")
return render_template(
current_app.config["DEPOSIT_UI_NEW_TEMPLATE"],
record={"_d`eposit": {"id": None}},
record={"_deposit": {"id": None}},
jsonschema=current_deposit.jsonschemas[deposit_type],
schemaform=current_deposit.schemaforms[deposit_type],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,15 @@ function cdsDepositCtrl(
true
);
$scope.$watch("$ctrl.record._deposit.status", function () {
Object.values($window.CKEDITOR.instances).forEach(function (instance) {
try {
instance.setReadOnly(instance.element.$.disabled);
} catch (error) {
// Do nothing probably not initialized yet
console.log(error);
}
$scope.$applyAsync(function () { // Manually trigger UI updates
Object.values($window.CKEDITOR.instances).forEach(function (instance) {
try {
instance.setReadOnly(instance.element.$.disabled);
} catch (error) {
// Do nothing probably not initialized yet
console.log(error);
}
});
});
});

Expand Down