fix navbar onfrontendevent && driverjs errors (#746)

This commit is contained in:
choper725 2023-12-29 11:42:47 +02:00 committed by GitHub
parent 28a84bfd0b
commit 0cb198b1e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 19 deletions

View File

@ -181,11 +181,11 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
` },` && |\n| &&
` onEventFrontend(...args) {` && |\n| &&
|\n| &&
` sap.z2ui5.onBeforeEventFrontend.forEach(item=>{` && |\n| &&
` sap.z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| &&
` if (item !== undefined) {` && |\n| &&
` item(args);` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` )` && |\n| &&
|\n| &&
` switch (args[0].EVENT) {` && |\n| &&
@ -223,8 +223,8 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
` sap.z2ui5.oController.PopoverDestroy();` && |\n| &&
` break;` && |\n| &&
` case 'NAV_CONTAINER_TO':` && |\n| &&
` let navCon = sap.z2ui5.oView.byId(args[1]);` && |\n| &&
` let navConTo = sap.z2ui5.oView.byId(args[2]);` && |\n| &&
` var navCon = sap.z2ui5.oView.byId(args[1]);` && |\n| &&
` var navConTo = sap.z2ui5.oView.byId(args[2]);` && |\n| &&
` navCon.to(navConTo);` && |\n| &&
` break;` && |\n| &&
` case 'NEST_NAV_CONTAINER_TO':` && |\n| &&
@ -234,7 +234,7 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
` break;` && |\n| &&
` case 'NEST2_NAV_CONTAINER_TO':` && |\n| &&
` navCon = sap.z2ui5.oViewNest2.byId(args[1]);` && |\n| &&
` navConTo = sap.z2ui5.oViewNest.byId(args[2]);` && |\n| &&
` navConTo = sap.z2ui5.oViewNest2.byId(args[2]);` && |\n| &&
` navCon.to(navConTo);` && |\n| &&
` break;` && |\n| &&
` }` && |\n| &&

View File

@ -176,7 +176,7 @@ CLASS Z2UI5_CL_CC_DRIVER_JS IMPLEMENTATION.
METHOD get_js_cc.
result = `sap.z2ui5.DriverJS = { };` &&
` debugger; sap.z2ui5.DriverJS.drive = function() {` && |\n| &&
`sap.z2ui5.DriverJS.drive = function() {` && |\n| &&
` if( driver !== undefined ) { if( config !== undefined ) {` && |\n| &&
` driverObj = driver(config);` && |\n| &&
` driverObj.drive();` && |\n| &&
@ -200,8 +200,8 @@ METHOD get_js_cc.
DATA(ls_highlight_driver_config) = i_highlight_driver_config.
"load driver object from window object
r_drive_js = `const driver = window.driver.js.driver;` && |\n| &&
`let driverObj = new Object();` && |\n|.
r_drive_js = `var driver = window.driver.js.driver;` && |\n| &&
`var driverObj = new Object();` && |\n|.
"handle tour
IF i_steps_config IS NOT INITIAL.
@ -241,7 +241,7 @@ METHOD get_js_cc.
` };` && |\n| &&
`};`.
r_drive_js = r_drive_js && |\n| && `debugger;` &&
r_drive_js = r_drive_js && |\n| &&
`for (var key of Object.keys(config)) {` && |\n| &&
` if( key.startsWith('on') ) {` && |\n| &&
` config[key] = new Function( config[key] );` && |\n| &&
@ -338,15 +338,15 @@ METHOD get_js_cc.
METHOD get_js_local.
result = `` && |\n| &&
`this.driver=this.driver||{};this.driver.js=function(D){"use strict";let F={};function z(e={}){F={animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,` &&
`popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...e}}function a(e){return e?F[e]:F}function W(e,o,t,i){return(e/=i/2)<1?t/2*e*e+o:-t/2*(--e*(e-2)-1)+o}` &&
`function q(` &&
`e){const o='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not(` &&
`[disabled])';return e.flatMap(t=>{const i=t.matches(o),p=Array.from(t.querySelectorAll(o));return[...i?[t]:[],...p]}).filter(t=>getComputedStyle(t).pointerEvents!=="none"&&ae(t))}function V(e){if(!e||se(e))return;` &&
`const o=a(` &&
`"smoothScroll");e.scrollIntoView({behavior:!o||re(e)?"auto":"smooth",inline:"center",block:"center"})}function re(e){if(!e||!e.parentElement)return;const o=e.parentElement;return ` &&
`o.scrollHeight>o.clientHeight}function se(e){const o=e.getBoundingClientRect();return o.top>=0&&o.left>=0&&o.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&o.right<=(` &&
`window.innerWidth||document.documentElement.clientWidth)}function ae(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let N={};function b(e,o){N[e]=o}function l(e){return e?N[e]:N}function K(){N={}}let E={};function O(e,o)` &&
`this.driver=this.driver||{};this.driver.js=function(D){"use strict";let F={};function z(e={}){F={animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,` &&
`popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...e}}function a(e){return e?F[e]:F}function W(e,o,t,i){return(e/=i/2)<1?t/2*e*e+o:-t/2*(--e*(e-2)-1)+o}` &&
`function q(` &&
`e){const o='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not(` &&
`[disabled])';return e.flatMap(t=>{const i=t.matches(o),p=Array.from(t.querySelectorAll(o));return[...i?[t]:[],...p]}).filter(t=>getComputedStyle(t).pointerEvents!=="none"&&ae(t))}function V(e){if(!e||se(e))return;` &&
`const o=a(` &&
`"smoothScroll");e.scrollIntoView({behavior:!o||re(e)?"auto":"smooth",inline:"center",block:"center"})}function re(e){if(!e||!e.parentElement)return;const o=e.parentElement;return ` &&
`o.scrollHeight>o.clientHeight}function se(e){const o=e.getBoundingClientRect();return o.top>=0&&o.left>=0&&o.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&o.right<=(` &&
`window.innerWidth||document.documentElement.clientWidth)}function ae(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}let N={};function b(e,o){N[e]=o}function l(e){return e?N[e]:N}function K(){N={}}let E={};function O(e,o)` &&
`{E[e]=o}function _(e){var o;(o=E[e])==null||o.call(E)}function ce(){E={}}function le(e,o,t,i){let p=l("__activeStagePosition");const n=p||t.getBoundingClientRect(),f=i.getBoundingClientRect(),w=W(e,n.x,f.x-n.x,o),r=W(e,n.y,f.y-n.y,o),v=W(e,` &&
`n.width,f.width-n.width,o),s=W(e,n.height,f.height-n.height,o);p={x:w,y:r,width:v,height:s},Y(p),b("__activeStagePosition",p)}function X(e){if(!e)return;const o=e.getBoundingClientRect(),t={x:o.x,y:o.y,width:o.width,height:o.height};b(` &&
`"__activeStagePosition",t),Y(t)}function de(){const e=l("__activeStagePosition"),o=l("__overlaySvg");if(!e)return;if(!o){console.warn("No stage svg found.");return}const t=window.innerWidth,` &&
@ -469,5 +469,4 @@ METHOD get_js_cc.
`D,Symbol.toStringTag,{value:"Module"}),D}({});`.
ENDMETHOD.
ENDCLASS.