Skip to content

Commit

Permalink
Correct bug where start did not bind events
Browse files Browse the repository at this point in the history
This commit corrects an issue where the `start` method was not rebinding
events after these event listeners after these events were removed using
`stop`.
  • Loading branch information
squat committed May 28, 2014
1 parent c9d20db commit 6e54434
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "postpone",
"main": "index.js",
"version": "0.6.3",
"version": "0.6.4",
"homepage": "https://github.com/lsvx/postpone",
"authors": [
"Lucas Serven <lserven@gmail.com>"
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "postpone",
"repo": "lsvx/postpone",
"description": "A polyfill for postponing the loading of media.",
"version": "0.6.3",
"version": "0.6.4",
"keywords": ["postpone", "media", "resource", "priority", "download"],
"dependencies": {},
"development": {},
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
*/
this.scrollElements = [];
this.setThreshold( threshold );
this.postpone();

/** Call method to start looking for postponed media. */
return this.start();
Expand Down Expand Up @@ -241,6 +240,11 @@
Postpone.prototype.start = function() {
/** Ensure that watching has stopped before starting to watch. */
if ( this.timeout ) this.stop();
/**
* Call `postpone` to ensure events are bound and items in view are
* loaded.
*/
this.postpone();
/** Start watching. */
this.watch();

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": "postpone",
"version": "0.6.3",
"version": "0.6.4",
"description": "A polyfill for postponing the loading of media.",
"main": "index.js",
"directories": {
Expand Down
6 changes: 5 additions & 1 deletion test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ require.register("postpone/index.js", Function("exports, require, module",
*/\n\
this.scrollElements = [];\n\
this.setThreshold( threshold );\n\
this.postpone();\n\
\n\
/** Call method to start looking for postponed media. */\n\
return this.start();\n\
Expand Down Expand Up @@ -443,6 +442,11 @@ require.register("postpone/index.js", Function("exports, require, module",
Postpone.prototype.start = function() {\n\
/** Ensure that watching has stopped before starting to watch. */\n\
if ( this.timeout ) this.stop();\n\
/**\n\
* Call `postpone` to ensure events are bound and items in view are\n\
* loaded.\n\
*/\n\
this.postpone();\n\
/** Start watching. */\n\
this.watch();\n\
\n\
Expand Down

0 comments on commit 6e54434

Please sign in to comment.