Skip to content

Commit

Permalink
chore(*): prepare release 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Dec 12, 2014
1 parent 1adc75a commit a97409d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 11 deletions.
11 changes: 8 additions & 3 deletions dist/amd/listener-expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@ define(["exports"], function (exports) {
"use strict";

var ListenerExpression = (function () {
var ListenerExpression = function ListenerExpression(eventManager, targetEvent, sourceExpression, delegate) {
var ListenerExpression = function ListenerExpression(eventManager, targetEvent, sourceExpression, delegate, preventDefault) {
this.eventManager = eventManager;
this.targetEvent = targetEvent;
this.sourceExpression = sourceExpression;
this.delegate = delegate;
this.discrete = true;
this.preventDefault = preventDefault;
};

ListenerExpression.prototype.createBinding = function (target) {
return new Listener(this.eventManager, this.targetEvent, this.delegate, this.sourceExpression, target);
return new Listener(this.eventManager, this.targetEvent, this.delegate, this.sourceExpression, target, this.preventDefault);
};

return ListenerExpression;
})();

exports.ListenerExpression = ListenerExpression;
var Listener = (function () {
var Listener = function Listener(eventManager, targetEvent, delegate, sourceExpression, target) {
var Listener = function Listener(eventManager, targetEvent, delegate, sourceExpression, target, preventDefault) {
this.eventManager = eventManager;
this.targetEvent = targetEvent;
this.delegate = delegate;
this.sourceExpression = sourceExpression;
this.target = target;
this.preventDefault = preventDefault;
};

Listener.prototype.bind = function (source) {
Expand All @@ -43,6 +45,9 @@ define(["exports"], function (exports) {
source.$event = event;
var result = _this.sourceExpression.eval(source);
source.$event = prevEvent;
if (_this.preventDefault) {
event.preventDefault();
}
return result;
}, this.delegate);
};
Expand Down
11 changes: 8 additions & 3 deletions dist/commonjs/listener-expression.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
"use strict";

var ListenerExpression = (function () {
var ListenerExpression = function ListenerExpression(eventManager, targetEvent, sourceExpression, delegate) {
var ListenerExpression = function ListenerExpression(eventManager, targetEvent, sourceExpression, delegate, preventDefault) {
this.eventManager = eventManager;
this.targetEvent = targetEvent;
this.sourceExpression = sourceExpression;
this.delegate = delegate;
this.discrete = true;
this.preventDefault = preventDefault;
};

ListenerExpression.prototype.createBinding = function (target) {
return new Listener(this.eventManager, this.targetEvent, this.delegate, this.sourceExpression, target);
return new Listener(this.eventManager, this.targetEvent, this.delegate, this.sourceExpression, target, this.preventDefault);
};

return ListenerExpression;
})();

exports.ListenerExpression = ListenerExpression;
var Listener = (function () {
var Listener = function Listener(eventManager, targetEvent, delegate, sourceExpression, target) {
var Listener = function Listener(eventManager, targetEvent, delegate, sourceExpression, target, preventDefault) {
this.eventManager = eventManager;
this.targetEvent = targetEvent;
this.delegate = delegate;
this.sourceExpression = sourceExpression;
this.target = target;
this.preventDefault = preventDefault;
};

Listener.prototype.bind = function (source) {
Expand All @@ -42,6 +44,9 @@ var Listener = (function () {
source.$event = event;
var result = _this.sourceExpression.eval(source);
source.$event = prevEvent;
if (_this.preventDefault) {
event.preventDefault();
}
return result;
}, this.delegate);
};
Expand Down
12 changes: 9 additions & 3 deletions dist/es6/listener-expression.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
export class ListenerExpression {
constructor(eventManager, targetEvent, sourceExpression, delegate){
constructor(eventManager, targetEvent, sourceExpression, delegate, preventDefault){
this.eventManager = eventManager;
this.targetEvent = targetEvent;
this.sourceExpression = sourceExpression;
this.delegate = delegate;
this.discrete = true;
this.preventDefault = preventDefault;
}

createBinding(target){
Expand All @@ -13,18 +14,20 @@ export class ListenerExpression {
this.targetEvent,
this.delegate,
this.sourceExpression,
target
target,
this.preventDefault
);
}
}

class Listener {
constructor(eventManager, targetEvent, delegate, sourceExpression, target){
constructor(eventManager, targetEvent, delegate, sourceExpression, target, preventDefault){
this.eventManager = eventManager;
this.targetEvent = targetEvent;
this.delegate = delegate;
this.sourceExpression = sourceExpression
this.target = target;
this.preventDefault = preventDefault;
}

bind(source){
Expand All @@ -42,6 +45,9 @@ class Listener {
source.$event = event;
var result = this.sourceExpression.eval(source);
source.$event = prevEvent;
if(this.preventDefault){
event.preventDefault();
}
return result;
}, this.delegate);
}
Expand Down
8 changes: 8 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 0.1.1 (2014-12-12)


#### Features

* **listener-expression:** add prevent default option for event listeners ([1adc75a7](http://github.com/aurelia/binding/commit/1adc75a7f517fea0658b2648acfff3451d8ba21b))


## 0.1.0 (2014-12-11)


Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ gulp.task('changelog', function(callback) {
changelog({
repository: pkg.repository.url,
version: pkg.version,
file: 'CHANGELOG.md'
file: path.doc + '/CHANGELOG.md'
}, function(err, log) {
fs.writeFileSync(path.doc + '/CHANGELOG.md', log);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-binding",
"version": "0.1.0",
"version": "0.1.1",
"description": "A modern databinding library for JavaScript and HTML.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit a97409d

Please sign in to comment.