Skip to content

Commit eb8bf0d

Browse files
committed
Cleanup and add stop polyfill.
1 parent 1ec6aca commit eb8bf0d

6 files changed

Lines changed: 29 additions & 3 deletions

File tree

build/CommentCoreLibrary.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ var CoreComment = (function () {
571571
}
572572
};
573573

574+
CoreComment.prototype.stop = function () {
575+
};
576+
574577
CoreComment.prototype.finish = function () {
575578
this.parent.finish(this);
576579
};
@@ -1009,6 +1012,9 @@ var CoreComment = (function () {
10091012
}
10101013
};
10111014

1015+
CoreComment.prototype.stop = function () {
1016+
};
1017+
10121018
CoreComment.prototype.finish = function () {
10131019
this.parent.finish(this);
10141020
};
@@ -1064,6 +1070,7 @@ var CSSCompatLayer = (function () {
10641070
};
10651071
return CSSCompatLayer;
10661072
})();
1073+
10671074
var CSSScrollComment = (function (_super) {
10681075
__extends(CSSScrollComment, _super);
10691076
function CSSScrollComment() {

build/CommentCoreLibrary.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/Comment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ var CoreComment = (function () {
391391
}
392392
};
393393

394+
CoreComment.prototype.stop = function () {
395+
};
396+
394397
CoreComment.prototype.finish = function () {
395398
this.parent.finish(this);
396399
};

src/core/Comment.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,14 @@ class CoreComment implements IComment {
395395
}
396396
}
397397

398+
/**
399+
* Notify the comment to stop. This has no effect if the comment
400+
* is driven by a timer.
401+
*/
402+
public stop():void {
403+
// Do nothing
404+
}
405+
398406
/**
399407
* Remove the comment and do some cleanup.
400408
*/

src/core/css/CSSComment.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ var CoreComment = (function () {
391391
}
392392
};
393393

394+
CoreComment.prototype.stop = function () {
395+
};
396+
394397
CoreComment.prototype.finish = function () {
395398
this.parent.finish(this);
396399
};
@@ -446,6 +449,7 @@ var CSSCompatLayer = (function () {
446449
};
447450
return CSSCompatLayer;
448451
})();
452+
449453
var CSSScrollComment = (function (_super) {
450454
__extends(CSSScrollComment, _super);
451455
function CSSScrollComment() {

src/core/css/CSSComment.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class CSSCompatLayer {
1414
dom.style["oTransform"] = trans;
1515
}
1616
}
17-
class CSSScrollComment extends ScrollComment{
17+
18+
class CSSScrollComment extends ScrollComment {
1819
private _dirtyCSS:boolean = true;
1920
set x(x:number){
2021
if(typeof this._x === "number") {
@@ -49,11 +50,14 @@ class CSSScrollComment extends ScrollComment{
4950
this._dirtyCSS = true;
5051
}
5152

53+
/**
54+
* Override the toplevel stop to actually stop the CSS.
55+
*/
5256
public stop():void{
5357
this.dom.style.transition = "";
5458
this.x = this._x;
5559
this._x = null;
5660
this.x = (this.ttl / this.dur) * (this.parent.width + this.width) - this.width;
5761
this._dirtyCSS = true;
5862
}
59-
}
63+
}

0 commit comments

Comments
 (0)