You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2019/12/11 16:17:26 UTC
[myfaces-tobago] branch master updated: TOBAGO-2014: Remove jQuery
dependency
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/master by this push:
new 3d05f04 TOBAGO-2014: Remove jQuery dependency
3d05f04 is described below
commit 3d05f0482e96a185ffc99ff5bf142755a8d24528
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Wed Dec 11 17:17:03 2019 +0100
TOBAGO-2014: Remove jQuery dependency
---
.../tobago-theme-standard/src/main/npm/js/tobago-myfaces.js | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/js/tobago-myfaces.js b/tobago-theme/tobago-theme-standard/src/main/npm/js/tobago-myfaces.js
index 127896e..2e7ae4d 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/js/tobago-myfaces.js
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/js/tobago-myfaces.js
@@ -5991,14 +5991,9 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse", _MF_OBJECT, /** @lends myfaces._impl.xhr
// begin TOBAGO-JSF-JS
// XXX hack
- if (node.id === document.getElementsByTagName("tobago-page")[0].id) {
- // newDoc = document.open("text/html", "replace");
- // newDoc.write(cDataBlock);
- // newDoc.close();
- //change only the body, because change the head doesn't work with CSP
- var newPage = jQuery(cDataBlock).filter("tobago-page");
- jQuery("tobago-page").replaceWith(newPage);
- // XXX remove jQuery
+ const oldPage = document.querySelector("tobago-page");
+ if (node.id === oldPage.id) {
+ oldPage.parentNode.innerHTML = cDataBlock;
resultNode = document.documentElement;
} else {
resultNode = this.replaceHtmlItem(request, context, node.getAttribute('id'), cDataBlock);