You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/05/07 14:47:36 UTC
[sling-org-apache-sling-app-cms] branch master updated: Fixing
issues where the RTE was clearing and it was not able to do an inplace
component update when the URLs are rewritten
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
The following commit(s) were added to refs/heads/master by this push:
new d486f22 Fixing issues where the RTE was clearing and it was not able to do an inplace component update when the URLs are rewritten
d486f22 is described below
commit d486f229d0664481532d0df377787c99c74390bf
Author: Dan Klco <dk...@apache.org>
AuthorDate: Tue May 7 07:52:01 2019 -0400
Fixing issues where the RTE was clearing and it was not able to do an
inplace component update when the URLs are rewritten
---
ui/src/main/frontend/src/js/cms.form.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/ui/src/main/frontend/src/js/cms.form.js b/ui/src/main/frontend/src/js/cms.form.js
index e657300..a397ae3 100644
--- a/ui/src/main/frontend/src/js/cms.form.js
+++ b/ui/src/main/frontend/src/js/cms.form.js
@@ -42,17 +42,19 @@ w * Licensed to the Apache Software Foundation (ASF) under one
}
});
if (form.dataset.addDate && !form.querySelector('input[name="jcr:content/jcr:lastModified"]')) {
+ var dateContainer = document.createElement('div');
if (jcrcontent) {
- form.innerHTML = form.innerHTML + '<input type="hidden" name="jcr:content/jcr:lastModified" />' +
+ dateContainer.innerHTML = '<input type="hidden" name="jcr:content/jcr:lastModified" />' +
'<input type="hidden" name="jcr:content/jcr:lastModifiedBy" />' +
'<input type="hidden" name="jcr:content/jcr:created" />' +
'<input type="hidden" name="jcr:content/jcr:createdBy" />';
} else {
- form.innerHTML = form.innerHTML + '<input type="hidden" name="jcr:lastModified" />' +
+ dateContainer.innerHTML = '<input type="hidden" name="jcr:lastModified" />' +
'<input type="hidden" name="jcr:lastModifiedBy" />' +
'<input type="hidden" name="jcr:created" />' +
'<input type="hidden" name="jcr:createdBy" />';
}
+ form.appendChild(dateContainer);
}
fetch(form.action, {
method: 'POST',
@@ -81,7 +83,7 @@ w * Licensed to the Apache Software Foundation (ASF) under one
Sling.CMS.handlers[callback](res, 'success');
} else if (window.parent.window.CMSEditor) {
var reloadParent = false,
- path = form.action;
+ path = res.path;
res.changes.forEach(function (change) {
if (change.type !== 'modified') {
reloadParent = true;