mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
Show warning message if several instances of Konva are added to page. close #113
This commit is contained in:
parent
c7ae11cd01
commit
6e3c69fae0
@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- event delegation. You can use it in this way: `layer.on('click', 'Circle', handler);`
|
||||
- new `node.findAncestors(selector)` and `node.findAncestor(selector)` functions
|
||||
- optional selector parametr for `stage.getIntersection` and `layer.getIntersection`
|
||||
- show warning message if several instances of Konva are added to page.
|
||||
|
||||
### Changed
|
||||
- `moveTo` and some other methods return `this`
|
||||
|
19
konva.js
19
konva.js
@ -3,7 +3,7 @@
|
||||
* Konva JavaScript Framework v0.11.0
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT or GPL Version 2 licenses.
|
||||
* Date: Sat Dec 26 2015
|
||||
* Date: Sat Jan 02 2016
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov (Konva)
|
||||
@ -27,6 +27,23 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// runtime check for already included Konva
|
||||
(function(){
|
||||
'use strict';
|
||||
var global =
|
||||
typeof window !== 'undefined' ? window :
|
||||
typeof global !== 'undefined' ? global :
|
||||
typeof WorkerGlobalScope !== 'undefined' ? self : {};
|
||||
|
||||
if (global.Konva) {
|
||||
console.error(
|
||||
'Konva instance is already exist in current eviroment. ' +
|
||||
'Please use only one instance.'
|
||||
);
|
||||
}
|
||||
})();
|
||||
|
||||
/**
|
||||
* @namespace Konva
|
||||
*/
|
||||
|
6
konva.min.js
vendored
6
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -27,6 +27,23 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// runtime check for already included Konva
|
||||
(function(){
|
||||
'use strict';
|
||||
var global =
|
||||
typeof window !== 'undefined' ? window :
|
||||
typeof global !== 'undefined' ? global :
|
||||
typeof WorkerGlobalScope !== 'undefined' ? self : {};
|
||||
|
||||
if (global.Konva) {
|
||||
console.error(
|
||||
'Konva instance is already exist in current eviroment. ' +
|
||||
'Please use only one instance.'
|
||||
);
|
||||
}
|
||||
})();
|
||||
|
||||
/**
|
||||
* @namespace Konva
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user