Skip to content

Commit 0179532

Browse files
author
Kai Schlamp
committed
The added style (by setting the height) is now removed again when destroying the ticker.
1 parent 544e95e commit 0179532

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

ui/jquery.ui.ticker.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ $.widget( "ui.ticker", {
6060
self.element.children( "li" ).addClass(itemClasses);
6161
self._addItemBindings(self.element.children( "li" ));
6262

63+
var style = self.element.attr("style");
64+
if (style === undefined || style === null) {
65+
self.originalStyle = null;
66+
}
67+
else {
68+
self.originalStyle = self.element.attr("style")
69+
}
6370
self.element.height(self.element.height());
6471
},
6572

@@ -74,14 +81,22 @@ $.widget( "ui.ticker", {
7481

7582
destroy: function() {
7683
var self = this;
84+
85+
if (self.timeoutId !== null) {
86+
window.clearTimeout(self.timeoutId);
87+
self.timeoutId = null;
88+
}
7789

7890
self.element.unbind(".ticker");
7991
self.element.children( "li" ).unbind(".ticker");
8092
self.element.removeClass( "ui-ticker ui-widget ui-corner-all" );
8193
self.element.children( "li" ).removeClass(itemClasses + " ui-state-hover ui-state-focus");
82-
if (self.timeoutId !== null) {
83-
window.clearTimeout(self.timeoutId);
84-
self.timeoutId = null;
94+
95+
if (self.originalStyle === null) {
96+
self.element.removeAttr("style");
97+
}
98+
else {
99+
self.element.attr("style", self.originalStyle);
85100
}
86101

87102
return $.Widget.prototype.destroy.call( self );

0 commit comments

Comments
 (0)