Skip to content

Commit

Permalink
[BUGFIX] Set Severity object properly
Browse files Browse the repository at this point in the history
This patch fixes two issues with setting the `Severity` object:
* Check if TYPO3 is an available namespace
* Store the object in `TYPO3.Severity`

Change-Id: Ice2b410f1a588c09f7a689f54ed127d8ee90f9fa
Resolves: #84007
Related: #83955
Releases: master
Reviewed-on: https://review.typo3.org/55859
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
  • Loading branch information
andreaskienast authored and NeoBlack committed Feb 21, 2018
1 parent 73bfbe1 commit 1150b86
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Build/types/TYPO3/index.d.ts
Expand Up @@ -10,6 +10,7 @@ declare namespace TYPO3 {
export let InfoWindow: any;
export let Notification: any;
export let Popover: any;
export let Severity: any;
export let ShortcutMenu: any;
export let Storage: any;
export let Utility: any;
Expand Down
Expand Up @@ -80,7 +80,11 @@ try {

if (!severityObject) {
severityObject = Severity;

// attach to global frame
if (typeof TYPO3 !== 'undefined') {
TYPO3.Severity = severityObject;
}
}

TYPO3.Storage = severityObject;
export = severityObject;
Expand Up @@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
define(["require","exports","./Enum/Severity"],function(a,b,c){"use strict";var d,e=function(){function a(){}return a.getCssClass=function(a){var b;switch(a){case c.SeverityEnum.notice:b="notice";break;case c.SeverityEnum.ok:b="success";break;case c.SeverityEnum.warning:b="warning";break;case c.SeverityEnum.error:b="danger";break;case c.SeverityEnum.info:default:b="info"}return b},a.notice=c.SeverityEnum.notice,a.info=c.SeverityEnum.info,a.ok=c.SeverityEnum.ok,a.warning=c.SeverityEnum.warning,a.error=c.SeverityEnum.error,a}();try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.Severity&&(d=window.opener.TYPO3.Severity),parent&&parent.window.TYPO3&&parent.window.TYPO3.Severity&&(d=parent.window.TYPO3.Severity),top&&top.TYPO3&&top.TYPO3.Severity&&(d=top.TYPO3.Severity)}catch(a){}return d||(d=e),TYPO3.Storage=d,d});
define(["require","exports","./Enum/Severity"],function(a,b,c){"use strict";var d,e=function(){function a(){}return a.getCssClass=function(a){var b;switch(a){case c.SeverityEnum.notice:b="notice";break;case c.SeverityEnum.ok:b="success";break;case c.SeverityEnum.warning:b="warning";break;case c.SeverityEnum.error:b="danger";break;case c.SeverityEnum.info:default:b="info"}return b},a.notice=c.SeverityEnum.notice,a.info=c.SeverityEnum.info,a.ok=c.SeverityEnum.ok,a.warning=c.SeverityEnum.warning,a.error=c.SeverityEnum.error,a}();try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.Severity&&(d=window.opener.TYPO3.Severity),parent&&parent.window.TYPO3&&parent.window.TYPO3.Severity&&(d=parent.window.TYPO3.Severity),top&&top.TYPO3&&top.TYPO3.Severity&&(d=top.TYPO3.Severity)}catch(a){}return d||(d=e,"undefined"!=typeof TYPO3&&(TYPO3.Severity=d)),d});

0 comments on commit 1150b86

Please sign in to comment.