Permalink
Browse files

Add jquery fallback (mostly for local dev), group JS together

  • Loading branch information...
1 parent 93f663f commit 0f3263eb2ebcb7714421ed486f828288df753bb3 @dsingleton committed Sep 1, 2011
Showing with 18 additions and 42 deletions.
  1. +0 −42 icons.js
  2. 0 { → js}/icon_data.js
  3. +18 −0 js/jquery.min.js
View
@@ -1,42 +0,0 @@
-$(document).ready(function() {
-
- var icon_list = $('ol.icons');
- var preview = $('#preview');
-
- // #1 Generate icon links
- $.each(icon_data, function(i, icon) {
- icon_list.append('<li><a title="' + icon.replace('_', ' ') + '"href="icons/' + icon + '"> \
- <img src="icons/' + icon + '"></a></li>');
- });
-
- var icon_links = $('ol.icons li a');
-
-
- icon_links.mouseenter(function(event) {
- var elem = $(event.target).parent();
- if (elem.hasClass('no-match')) {
- preview.offset({
- 'left': elem.offset().left - 24,
- 'top': elem.offset().top - 24
- }).html(elem.clone()).show();
- }
- });
-
- icon_list.mouseleave(function() {
- preview.hide();
- });
-
-
- $('#search').keyup(function() {
- apply_filter(this.value);
- preview.hide();
- });
-
- var apply_filter = function(value) {
- window.location.hash = value;
- icon_links.each(function() {
- $(this).toggleClass('no-match', (this.title.indexOf(value) == -1));
- });
- };
- apply_filter(window.location.hash.substring(1));
-});
File renamed without changes.
Oops, something went wrong.

0 comments on commit 0f3263e

Please sign in to comment.