change style of toast from predefined class (#1110)

This commit is contained in:
choper725 2024-04-29 20:12:08 +03:00 committed by GitHub
parent 7904dad027
commit 1dd11a1495
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 3 deletions

View File

@ -97,7 +97,6 @@ CLASS Z2UI5_CL_CORE_CLIENT IMPLEMENTATION.
METHOD z2ui5_if_client~message_toast_display.
mo_action->ms_next-s_set-s_msg_toast = VALUE #(
id = id
text = text
duration = duration
width = width
@ -111,6 +110,7 @@ CLASS Z2UI5_CL_CORE_CLIENT IMPLEMENTATION.
animationtimingfunction = animationtimingfunction
animationduration = animationduration
closeonbrowsernavigation = closeonbrowsernavigation
class = class
).
ENDMETHOD.

View File

@ -450,6 +450,11 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION.
` animationDuration: parseInt(params[msgType].ANIMATIONDURATION),` && |\n| &&
` closeonBrowserNavigation: params[msgType].CLOSEONBROWSERNAVIGATION ? true : false` && |\n| &&
` });` && |\n| &&
` if(params[msgType].CLASS) {` && |\n| &&
` let mtoast = {};` && |\n| &&
` mtoast = document.getElementsByClassName("sapMMessageToast")[0];` && |\n| &&
` if(mtoast) { mtoast.classList.add(params[msgType].CLASS); }` && |\n| &&
` };` && |\n| &&
` } else if (msgType === 'S_MSG_BOX') {` && |\n| &&
` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| &&
` }` && |\n| &&

View File

@ -87,7 +87,7 @@ INTERFACE z2ui5_if_core_types
text TYPE string,
END OF s_msg_box,
BEGIN OF s_msg_toast,
id TYPE string,
class TYPE string,
text TYPE string,
duration TYPE string,
width TYPE string,

View File

@ -102,7 +102,6 @@ INTERFACE z2ui5_if_client
METHODS message_toast_display
IMPORTING
id TYPE string OPTIONAL
text TYPE string
duration TYPE string DEFAULT `3000`
width TYPE string DEFAULT `15em`
@ -116,6 +115,7 @@ INTERFACE z2ui5_if_client
animationtimingfunction TYPE string DEFAULT `ease`
animationduration TYPE string DEFAULT `1000`
closeonbrowsernavigation TYPE abap_bool DEFAULT abap_true
class TYPE string OPTIONAL
PREFERRED PARAMETER text.
METHODS _event