mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
optional warnings displaying
This commit is contained in:
parent
7e3803bdd1
commit
f573b3a76b
11
kinetic.js
11
kinetic.js
@ -82,6 +82,15 @@ var Kinetic = {};
|
|||||||
* node.rotation(Math.PI / 2); // PI/2 radian
|
* node.rotation(Math.PI / 2); // PI/2 radian
|
||||||
*/
|
*/
|
||||||
angleDeg: true,
|
angleDeg: true,
|
||||||
|
/**
|
||||||
|
* Show different warnings about errors or wrong API usage
|
||||||
|
* @property
|
||||||
|
* @default true
|
||||||
|
* @memberof Kinetic
|
||||||
|
* @example
|
||||||
|
* Kinetic.showWarnings = false;
|
||||||
|
*/
|
||||||
|
showWarnings : true,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1244,7 +1253,7 @@ var Kinetic = {};
|
|||||||
* IE9 on Windows7 64bit will throw a JS error
|
* IE9 on Windows7 64bit will throw a JS error
|
||||||
* if we don't use window.console in the conditional
|
* if we don't use window.console in the conditional
|
||||||
*/
|
*/
|
||||||
if(Kinetic.root.console && console.warn) {
|
if(Kinetic.root.console && console.warn && Kinetic.showWarnings) {
|
||||||
console.warn(KINETIC_WARNING + str);
|
console.warn(KINETIC_WARNING + str);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
6
kinetic.min.js
vendored
6
kinetic.min.js
vendored
File diff suppressed because one or more lines are too long
@ -82,6 +82,15 @@ var Kinetic = {};
|
|||||||
* node.rotation(Math.PI / 2); // PI/2 radian
|
* node.rotation(Math.PI / 2); // PI/2 radian
|
||||||
*/
|
*/
|
||||||
angleDeg: true,
|
angleDeg: true,
|
||||||
|
/**
|
||||||
|
* Show different warnings about errors or wrong API usage
|
||||||
|
* @property
|
||||||
|
* @default true
|
||||||
|
* @memberof Kinetic
|
||||||
|
* @example
|
||||||
|
* Kinetic.showWarnings = false;
|
||||||
|
*/
|
||||||
|
showWarnings : true,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@
|
|||||||
* IE9 on Windows7 64bit will throw a JS error
|
* IE9 on Windows7 64bit will throw a JS error
|
||||||
* if we don't use window.console in the conditional
|
* if we don't use window.console in the conditional
|
||||||
*/
|
*/
|
||||||
if(Kinetic.root.console && console.warn) {
|
if(Kinetic.root.console && console.warn && Kinetic.showWarnings) {
|
||||||
console.warn(KINETIC_WARNING + str);
|
console.warn(KINETIC_WARNING + str);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -58,6 +58,7 @@ function init() {
|
|||||||
|
|
||||||
|
|
||||||
Kinetic.enableTrace = true;
|
Kinetic.enableTrace = true;
|
||||||
|
Kinetic.showWarnings = false;
|
||||||
|
|
||||||
function addStats() {
|
function addStats() {
|
||||||
stats = new Stats();
|
stats = new Stats();
|
||||||
|
Loading…
Reference in New Issue
Block a user