Show warning message if several instances of Konva are added to page. close #113

This commit is contained in:
Anton Lavrenov 2016-01-02 17:33:50 +08:00
parent c7ae11cd01
commit 6e3c69fae0
4 changed files with 39 additions and 4 deletions

View File

@ -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`

View File

@ -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

File diff suppressed because one or more lines are too long

View File

@ -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
*/