Skip to content

Commit

Permalink
undo change that broke tests. :/
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciosoares committed Sep 29, 2015
1 parent e872431 commit 35ade56
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
5 changes: 1 addition & 4 deletions dist/provent.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ var _helpersToArray = require('./helpers/toArray');
var _helpersToArray2 = _interopRequireDefault(_helpersToArray);

function Provent(elements, event) {
var _arguments = arguments,
_this = this;

if (!event) throw new Error('You must choose an event');

var promise = (0, _promise2['default'])();
Expand All @@ -140,7 +137,7 @@ function Provent(elements, event) {

elements.forEach(function (element) {
element.addEventListener(event, handler = function () {
promise._triggerAll.call(promise, (0, _helpersToArray2['default'])(_arguments), _this);
promise._triggerAll.call(promise, (0, _helpersToArray2['default'])(arguments), this);
});
});

Expand Down
2 changes: 1 addition & 1 deletion dist/provent.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/provent.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,13 @@
</head>
<body>
<a id="a1" href="#">link test</a>
<script src="../dist/provent.min.js"></script>
<script src="../dist/provent.js"></script>
<script>
var aClick = Provent(document.querySelectorAll('a'), 'click')

aClick.then(function(param) {
console.log(param);
return true;
}).then('#toRemove', function(param) {
console.log('toremove', param);
}).then('#toRemove', function(param) {
console.log(param);
return false;
}).then(function(param) {
console.log('last',param);
console.log(this);
});

// aClick.reject();
Expand Down
2 changes: 1 addition & 1 deletion src/provent.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Provent(elements, event) {
if(!elements.length) return;

elements.forEach((element) => {
element.addEventListener(event, handler = () => {
element.addEventListener(event, handler = function() {
promise._triggerAll.call(promise, toArray(arguments), this);
});
});
Expand Down

0 comments on commit 35ade56

Please sign in to comment.