diff --git a/src/base/foundation/message.js b/src/base/foundation/message.js index 860449ab4..156297c9d 100644 --- a/src/base/foundation/message.js +++ b/src/base/foundation/message.js @@ -22,6 +22,7 @@ BI.Msg = function () { // BI.Msg.prompt(title, message, value, callback, min_width); }, toast: function (message, options, context) { + BI.isString(options) && (options = { level: options }) options = options || {}; context = context || BI.Widget._renderEngine.createElement("body"); var level = options.level || "common"; diff --git a/typescript/base/foundation/message.ts b/typescript/base/foundation/message.ts index ce7d54c3a..63790d1cb 100644 --- a/typescript/base/foundation/message.ts +++ b/typescript/base/foundation/message.ts @@ -2,5 +2,5 @@ export type _msg = { alert: (title: string, message?: string | {[key: string]: any}, callback?: (result?: boolean)=>void) => void confirm: (title: string, message?: string | {[key: string]: any}, callback?: (result: boolean)=>void) => void prompt: (title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number) => void - toast: (message: string, options?: object, context?: HTMLElement) => void + toast: (message: string, options?: object | string, context?: HTMLElement) => void }