driver.js fix (#631)

This commit is contained in:
oblomov 2023-11-07 10:15:36 +01:00 committed by GitHub
parent fab5410988
commit 4ff68e7de5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,11 +146,11 @@
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
ENDCLASS.
CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
CLASS z2ui5_cl_cc_driver_js IMPLEMENTATION.
METHOD constructor.
@ -333,22 +333,30 @@ CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
IF css_url IS INITIAL.
IF local_css = abap_true.
css = css && `<html:style>` && get_css_local( ) && `</html:style>` && |\n|.
css = css && get_css_local( ) && |\n|.
ENDIF.
ELSE.
css = css && `<html:style>` && css_url && `</html:style>` && |\n|.
* css = css && `<html:style>` && css_url && `</html:style>` && |\n|.
css = css && css_url && |\n|.
ENDIF.
IF js_url IS INITIAL.
IF local_js = abap_true.
js = js && `<html:script>` && get_js_local( ) && `</html:script>` && |\n|.
* js = js && `<html:script>` && get_js_local( ) && `</html:script>` && |\n|.
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( get_js_local( ) )->get_parent( ).
ENDIF.
ELSE.
js = js && `<html:script src="` && js_url && `" ></html:script>` && |\n|.
result = mo_view->_generic( ns = `html` name = `script` t_prop = VALUE #( ( n = `src` v = js_url ) ) )->get_parent( ).
ENDIF.
DATA(final) = js && |\n| && css ##NEEDED.
result = mo_view->_cc_plain_xml( js )->get_parent( )->_cc_plain_xml( css ).
* result = mo_view->_cc_plain_xml( js )->get_parent( )->_cc_plain_xml( css ).
result = mo_view->_generic( ns = `html` name = `style` )->_cc_plain_xml( css ).
"->get_parent( ).
ENDMETHOD.
@ -493,8 +501,8 @@ CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
ENDIF.
result = mo_view->_cc_plain_xml( `<html:script>` && drive_js && `</html:script>` ).
* result = mo_view->_cc_plain_xml( `<html:script>` && drive_js && `</html:script>` ).
result = mo_view->_generic( ns = `html` name = `script` )->_cc_plain_xml( drive_js ).
ENDMETHOD.
ENDCLASS.
ENDCLASS.