Jump to content
uniGUI Discussion Forums

WMC Ederson

uniGUI Subscriber
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About WMC Ederson

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. WMC Ederson

    SweetAlert2

    Hey, I found some others issues on the code from jToast. There is what I changed (in uniJToast > BuildJsonParams): allowToastClose if allowToastClose then bstr := bstr + 'allowToastClose:true,' else bstr := bstr + 'allowToastClose:false,'; stack if (stack) then bstr := bstr + 'stack:' + IntToStr(stackSize) +',' else bstr := bstr + 'stack:false,'; position bstr := bstr + 'position:' + '"' + StringReplace(GetPosition(pos), '_', '-', [rfReplaceAll]) + '",'; loader (like Pep's post) if loader then begin bstr := bstr + 'loader:true,'; bstr := bstr + 'loaderBg: ' + '"' + loaderBg + '",'; end else bstr := bstr + 'loader:false,'; With these changes the component worked perfectly. Here is all procedure code: function TUniJToast.BuildJsonParams: string; var bstr: string; begin bstr := '{'; bstr := bstr + 'text:' + '"' + text + '",'; bstr := bstr + 'heading:' + '"' + heading + '",'; bstr := bstr + 'icon:' + '"' + GetIconType(icon) + '",'; bstr := bstr + 'showHideTransition:' + '"' + GetTransition(showHideTransition) + '",'; if allowToastClose then bstr := bstr + 'allowToastClose:true,' else bstr := bstr + 'allowToastClose:false,'; if hideAfter > 0 then bstr := bstr + 'hideAfter:' + IntToStr(hideAfter) + ','; if (stack) then bstr := bstr + 'stack:' + IntToStr(stackSize) +',' else bstr := bstr + 'stack:false,'; bstr := bstr + 'position:' + '"' + StringReplace(GetPosition(pos), '_', '-', [rfReplaceAll]) + '",'; bstr := bstr + 'textAlign:' + '"' + GetTextAlign(textAlign) + '",'; if loader then begin bstr := bstr + 'loader:true,'; bstr := bstr + 'loaderBg: ' + '"' + loaderBg + '",'; end else bstr := bstr + 'loader:false,'; // Add Callbacks here bstr := bstr + 'beforeShow: function() { ajaxRequest('+JSName+',"beforeShow",[]); },'; bstr := bstr + 'afterShown: function() { ajaxRequest('+JSName+',"afterShown",[]); },'; bstr := bstr + 'beforeHide: function() { ajaxRequest('+JSName+',"beforeHide",[]); },'; bstr := bstr + 'afterHidden: function() { ajaxRequest('+JSName+',"afterHidden",[]); }'; bstr := bstr + '}'; result := bstr; end;
×