Merge branch 'master' of github.com:ericdrowell/KineticJS

This commit is contained in:
Лаврёнов Антон 2014-03-01 20:16:27 +08:00
commit 0821d7c99d
4 changed files with 13 additions and 46 deletions

View File

@ -58,7 +58,7 @@ module.exports = function(grunt) {
];
// Project configuration.
var lintConf = grunt.file.readJSON('.jshintrc');
var hintConf = grunt.file.readJSON('.jshintrc');
var config = {
pkg: grunt.file.readJSON('package.json'),
concat: {
@ -181,7 +181,7 @@ module.exports = function(grunt) {
build: ['dist/*']
},
jshint: {
options: lintConf,
options: hintConf,
all: ['src/**/*.js']
},
copy: {
@ -252,7 +252,7 @@ module.exports = function(grunt) {
'shell:jsdoc',
]);
grunt.registerTask('lint', 'Check lint errors', ['jshint']);
grunt.registerTask('hint', 'Check hint errors', ['jshint']);
grunt.registerTask('test', 'Run tests', ['dev', 'mocha_phantomjs']);
grunt.registerTask('server', 'run local server and create dev version', function() {

View File

@ -1,6 +1,6 @@
{
"name": "KineticJS",
"version": "5.0.1",
"version": "5.0.2",
"devDependencies": {
"grunt-contrib-jshint": "0.8.0",
"grunt-contrib-nodeunit": "0.3.2",
@ -16,10 +16,10 @@
"grunt": "0.4.2",
"connect": "2.13.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-shell": "^0.6.4",
"jsdoc": "^3.3.0-alpha4",
"grunt-mocha-phantomjs": "^0.4.2",
"grunt-contrib-watch": "^0.5.3"
"jsdoc": "~3.3.0-alpha4",
"grunt-mocha-phantomjs": "~0.4.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-shell": "~0.6.4"
},
"readmeFilename": "README.md",
"main": "kinetic.js",

View File

@ -351,6 +351,7 @@
},
_mouseover: function(evt) {
if (!Kinetic.UA.mobile) {
this._setPointerPosition(evt);
this._fire(CONTENT_MOUSEOVER, evt);
}
},
@ -369,7 +370,7 @@
this._fire(CONTENT_MOUSEOUT, evt);
}
},
_mousemove: Kinetic.Util._throttle(function(evt) {
_mousemove: function(evt) {
if (!Kinetic.UA.mobile) {
this._setPointerPosition(evt);
var dd = Kinetic.DD,
@ -415,7 +416,7 @@
if (evt.preventDefault) {
evt.preventDefault();
}
}, 17),
},
_mousedown: function(evt) {
if (!Kinetic.UA.mobile) {
this._setPointerPosition(evt);
@ -549,7 +550,7 @@
Kinetic.listenClickTap = false;
},
_touchmove: Kinetic.Util._throttle(function(evt) {
_touchmove: function(evt) {
this._setPointerPosition(evt);
var dd = Kinetic.DD,
shape = this.getIntersection(this.getPointerPosition());
@ -568,7 +569,7 @@
if(dd) {
dd._drag(evt);
}
}, 17),
},
_setPointerPosition: function(evt) {
var contentPosition = this._getContentPosition(),
offsetX = evt.offsetX,

View File

@ -1,34 +0,0 @@
suite('KineticEvents', function() {
// ======================================================
test('draw events', function() {
var stage = addStage();
var layer = new Kinetic.Layer();
var circle = new Kinetic.Circle({
x: stage.getWidth() / 2,
y: stage.getHeight() / 2,
radius: 70,
fill: 'red'
});
var events = [];
layer.on('draw', function(evt) {
events.push('layer-draw');
});
layer.on('beforeDraw', function(evt) {
events.push('layer-beforeDraw');
});
layer.add(circle);
stage.add(layer);
//console.log(events.toString())
assert.equal(events.toString(), 'layer-beforeDraw,layer-draw', 'draw event order is incorrect');
});
});