Permalink
Browse files

Fix pager icons to use a container so that ui-state-default/hover bac…

…kground images will work as expected
  • Loading branch information...
1 parent 210cbab commit b78e2f799bbe7e30ee3716929cd196f08188df2b @brandonaaron brandonaaron committed with mleibman Apr 20, 2010
Showing with 12 additions and 13 deletions.
  1. +1 −1 slick.pager.css
  2. +11 −12 slick.pager.js
View
2 slick.pager.css
@@ -14,7 +14,7 @@
padding: 6px;
}
-.slick-pager .ui-icon
+.slick-pager .ui-icon-container
{
display: inline-block;
margin: 2px;
View
23 slick.pager.js
@@ -87,33 +87,32 @@
}
});
- $("<span class='ui-icon ui-icon-lightbulb' />")
+ var icon_prefix = "<span class='ui-state-default ui-corner-all ui-icon-container'><span class='ui-icon ";
+ var icon_suffix = "' /></span>";
+
+ $(icon_prefix + "ui-icon-lightbulb" + icon_suffix)
.click(function() { $(".slick-pager-settings-expanded").toggle() })
.appendTo($settings);
- $("<span class='ui-icon ui-icon-seek-first' />")
+ $(icon_prefix + "ui-icon-seek-first" + icon_suffix)
.click(gotoFirst)
.appendTo($nav);
- $("<span class='ui-icon ui-icon-seek-prev' />")
+ $(icon_prefix + "ui-icon-seek-prev" + icon_suffix)
.click(gotoPrev)
.appendTo($nav);
- $("<span class='ui-icon ui-icon-seek-next' />")
+ $(icon_prefix + "ui-icon-seek-next" + icon_suffix)
.click(gotoNext)
.appendTo($nav);
- $("<span class='ui-icon ui-icon-seek-end' />")
+ $(icon_prefix + "ui-icon-seek-end" + icon_suffix)
.click(gotoLast)
.appendTo($nav);
- $container.find(".ui-icon")
- .addClass("ui-state-default ui-corner-all")
- .mouseover(function(e) {
- $(e.target).addClass("ui-state-hover")
- })
- .mouseout(function(e) {
- $(e.target).removeClass("ui-state-hover")
+ $container.find(".ui-icon-container")
+ .hover(function() {
+ $(this).toggleClass("ui-state-hover");
});
$container.children().wrapAll("<div class='slick-pager' />");

0 comments on commit b78e2f7

Please sign in to comment.