mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-11 09:24:58 +00:00
Fix crashes when open the window
This commit is contained in:
parent
327ef6c810
commit
8b0314a965
2
app.js
2
app.js
|
@ -70,7 +70,7 @@ var console = {
|
||||||
var params = {
|
var params = {
|
||||||
type: type,
|
type: type,
|
||||||
channel: 'default',
|
channel: 'default',
|
||||||
messsage: '',
|
message: '',
|
||||||
datetime: new Date().toISOString()
|
datetime: new Date().toISOString()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
14
webloader.js
14
webloader.js
|
@ -9,7 +9,13 @@ var OldBrowser = require("lib/oldbrowser");
|
||||||
// Override global.console._echo()
|
// Override global.console._echo()
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
global.console._echo = function(args, type) {
|
global.console._echo = function(args, type) {
|
||||||
var heading, icon, msg = this._join(args);
|
var heading, icon, message = this._join(args);
|
||||||
|
var params = {
|
||||||
|
type: type,
|
||||||
|
channel: 'default',
|
||||||
|
message: '',
|
||||||
|
datetime: new Date().toISOString()
|
||||||
|
};
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "error":
|
case "error":
|
||||||
|
@ -36,17 +42,17 @@ global.console._echo = function(args, type) {
|
||||||
if (typeof(window.jQuery.toast) !== "undefined") {
|
if (typeof(window.jQuery.toast) !== "undefined") {
|
||||||
window.jQuery.toast({
|
window.jQuery.toast({
|
||||||
heading: heading,
|
heading: heading,
|
||||||
text: msg,
|
text: message,
|
||||||
icon: icon
|
icon: icon
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
window.alert(msg);
|
window.alert(message);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
window.alert(e.message);
|
window.alert(e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._messages.push(msg);
|
this._messages.push(message);
|
||||||
|
|
||||||
if (params.channel != "default" && this._echoCallback != null) {
|
if (params.channel != "default" && this._echoCallback != null) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user