groundworkcss-rails 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/lib/groundworkcss/rails/version.rb +1 -1
  2. data/lib/groundworkcss/rails/version.rb~ +1 -1
  3. data/vendor/assets/javascripts/groundworkcss/components/disabled.js +13 -12
  4. data/vendor/assets/javascripts/groundworkcss/components/equalizeColumns.js +31 -28
  5. data/vendor/assets/javascripts/groundworkcss/components/forms.js +21 -20
  6. data/vendor/assets/javascripts/groundworkcss/components/menus.js +88 -78
  7. data/vendor/assets/javascripts/groundworkcss/components/modals.js +7 -4
  8. data/vendor/assets/javascripts/groundworkcss/components/pagination.js +87 -82
  9. data/vendor/assets/javascripts/groundworkcss/components/responsiveTables.js +22 -18
  10. data/vendor/assets/javascripts/groundworkcss/components/responsiveText.js +38 -31
  11. data/vendor/assets/javascripts/groundworkcss/components/tabs.js +19 -17
  12. data/vendor/assets/javascripts/groundworkcss/components/tiles.js +24 -21
  13. data/vendor/assets/javascripts/groundworkcss/components/tooltips.js +7 -4
  14. data/vendor/assets/javascripts/groundworkcss/groundwork.all.js +974 -821
  15. data/vendor/assets/javascripts/groundworkcss/plugins/jquery-modals.js +193 -0
  16. data/vendor/assets/javascripts/groundworkcss/plugins/jquery-popover.js +208 -0
  17. data/vendor/assets/javascripts/groundworkcss/plugins/jquery-responsiveTables.js +64 -0
  18. data/vendor/assets/javascripts/groundworkcss/plugins/jquery-responsiveText.js +46 -0
  19. data/vendor/assets/javascripts/groundworkcss/plugins/jquery-tooltip.js +137 -0
  20. data/vendor/assets/stylesheets/groundworkcss-scss/_settings.scss +149 -0
  21. data/vendor/assets/stylesheets/groundworkcss-scss/base/_all.scss +11 -0
  22. data/vendor/assets/stylesheets/groundworkcss-scss/{_animations.scss → base/_animations.scss} +7 -3
  23. data/vendor/assets/stylesheets/groundworkcss-scss/{_global.scss → base/_global.scss} +27 -10
  24. data/vendor/assets/stylesheets/groundworkcss-scss/{_grid.scss → base/_grid.scss} +5 -3
  25. data/vendor/assets/stylesheets/groundworkcss-scss/{_helpers.scss → base/_helpers.scss} +61 -18
  26. data/vendor/assets/stylesheets/groundworkcss-scss/{_reset.scss → base/_reset.scss} +36 -31
  27. data/vendor/assets/stylesheets/groundworkcss-scss/core/_all.scss +11 -0
  28. data/vendor/assets/stylesheets/groundworkcss-scss/{_variables.scss → core/_constants.scss} +7 -58
  29. data/vendor/assets/stylesheets/groundworkcss-scss/core/_defaults.scss +150 -0
  30. data/vendor/assets/stylesheets/groundworkcss-scss/{_mixins.scss → core/_mixins.scss} +6 -97
  31. data/vendor/assets/stylesheets/groundworkcss-scss/form/_all.scss +10 -0
  32. data/vendor/assets/stylesheets/groundworkcss-scss/{_forms.scss → form/_forms.scss} +96 -80
  33. data/vendor/assets/stylesheets/groundworkcss-scss/form/_tiles.scss +100 -0
  34. data/vendor/assets/stylesheets/groundworkcss-scss/groundwork-ie.scss +10 -8
  35. data/vendor/assets/stylesheets/groundworkcss-scss/groundwork.scss +12 -32
  36. data/vendor/assets/stylesheets/groundworkcss-scss/{_popovers.scss → misc/_all.scss} +3 -4
  37. data/vendor/assets/stylesheets/groundworkcss-scss/{_social-icons.scss → misc/_social-icons.scss} +4 -0
  38. data/vendor/assets/stylesheets/groundworkcss-scss/nav/_all.scss +11 -0
  39. data/vendor/assets/stylesheets/groundworkcss-scss/nav/_buttons.scss +328 -0
  40. data/vendor/assets/stylesheets/groundworkcss-scss/{_navigation.scss → nav/_navigation.scss} +8 -5
  41. data/vendor/assets/stylesheets/groundworkcss-scss/nav/_tabs.scss +230 -0
  42. data/vendor/assets/stylesheets/groundworkcss-scss/no-svg.scss +9 -7
  43. data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_all.scss +13 -0
  44. data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_desktop.scss +26 -0
  45. data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_helpers.scss +16 -0
  46. data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_ipad.scss +28 -0
  47. data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_mobile.scss +44 -0
  48. data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_small-tablet.scss +196 -0
  49. data/vendor/assets/stylesheets/groundworkcss-scss/type/_all.scss +9 -0
  50. data/vendor/assets/stylesheets/groundworkcss-scss/{_font-awesome.scss → type/_font-awesome.scss} +10 -2
  51. data/vendor/assets/stylesheets/groundworkcss-scss/{_typography.scss → type/_typography.scss} +172 -60
  52. data/vendor/assets/stylesheets/groundworkcss-scss/type/_webfonts.scss +28 -0
  53. data/vendor/assets/stylesheets/groundworkcss-scss/{_ui-elements.scss → ui/_all.scss} +4 -0
  54. data/vendor/assets/stylesheets/groundworkcss-scss/ui/_callouts.scss +117 -0
  55. data/vendor/assets/stylesheets/groundworkcss-scss/ui/_messages.scss +111 -0
  56. data/vendor/assets/stylesheets/groundworkcss-scss/{_modals.scss → ui/_modals.scss} +2 -0
  57. data/vendor/assets/stylesheets/groundworkcss-scss/ui/_popovers.scss +81 -0
  58. data/vendor/assets/stylesheets/groundworkcss-scss/ui/_tables.scss +142 -0
  59. data/vendor/assets/stylesheets/groundworkcss-scss/{_tooltips.scss → ui/_tooltips.scss} +35 -0
  60. metadata +56 -40
  61. data/vendor/assets/stylesheets/groundworkcss-scss/_buttons.scss +0 -231
  62. data/vendor/assets/stylesheets/groundworkcss-scss/_callouts.scss +0 -74
  63. data/vendor/assets/stylesheets/groundworkcss-scss/_cycle.scss +0 -20
  64. data/vendor/assets/stylesheets/groundworkcss-scss/_messages.scss +0 -69
  65. data/vendor/assets/stylesheets/groundworkcss-scss/_mobile-reset.scss +0 -11
  66. data/vendor/assets/stylesheets/groundworkcss-scss/_responsive.scss +0 -246
  67. data/vendor/assets/stylesheets/groundworkcss-scss/_tables.scss +0 -85
  68. data/vendor/assets/stylesheets/groundworkcss-scss/_tabs.scss +0 -172
  69. data/vendor/assets/stylesheets/groundworkcss-scss/_tiles.scss +0 -198
  70. data/vendor/assets/stylesheets/groundworkcss-scss/_webfonts.scss +0 -19
@@ -1,5 +1,5 @@
1
1
  module Groundworkcss
2
2
  module Rails
3
- VERSION = "0.2.9"
3
+ VERSION = "0.2.10"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Groundworkcss
2
2
  module Rails
3
- VERSION = "0.2.8"
3
+ VERSION = "0.2.10"
4
4
  end
5
5
  end
@@ -1,13 +1,14 @@
1
- // Generated by CoffeeScript 1.6.1
2
-
3
- $(function() {
4
- $('.disabled').each(function() {
5
- $(this).attr('tabindex', '-1');
6
- $(this).find('a').attr('tabindex', '-1');
7
- return $(this).find('input, select, textarea').addClass('disabled').attr('tabindex', '-1').attr('readonly', 'readyonly');
8
- });
9
- $('body').on('click', '.disabled, .disabled *', function(e) {
10
- e.preventDefault();
11
- return false;
1
+ (function() {
2
+ $(function() {
3
+ $('.disabled').each(function() {
4
+ $(this).attr('tabindex', '-1');
5
+ $(this).find('a').attr('tabindex', '-1');
6
+ return $(this).find('input, select, textarea').addClass('disabled').attr('tabindex', '-1').attr('readonly', 'readyonly');
7
+ });
8
+ $('body').on('click', '.disabled, .disabled *', function(e) {
9
+ e.preventDefault();
10
+ return false;
11
+ });
12
12
  });
13
- });
13
+
14
+ }).call(this);
@@ -1,34 +1,37 @@
1
- // Generated by CoffeeScript 1.6.1
2
- var equalizeColumns;
1
+ (function() {
2
+ var equalizeColumns;
3
3
 
4
- $(window).load(function() {
5
- return equalizeColumns();
6
- });
4
+ $(window).load(function() {
5
+ return equalizeColumns();
6
+ });
7
7
 
8
- $(window).resize(function() {
9
- return equalizeColumns();
10
- });
8
+ $(window).resize(function() {
9
+ return equalizeColumns();
10
+ });
11
11
 
12
- equalizeColumns = function() {
13
- return $('.row.equalize').each(function() {
14
- var $row, collapsed, tallest;
15
- $row = $(this);
16
- tallest = 0;
17
- collapsed = false;
18
- $(this).children('*').each(function(i) {
19
- $(this).css('min-height', '1px');
20
- collapsed = $(this).outerWidth() === $row.outerWidth();
21
- if (!collapsed) {
22
- if (!$(this).hasClass('equal')) {
23
- $(this).addClass('equal');
24
- }
25
- if ($(this).outerHeight() > tallest) {
26
- return tallest = $(this).outerHeight();
12
+ equalizeColumns = function() {
13
+ return $('.row.equalize').each(function() {
14
+ var $row, collapsed, tallest;
15
+
16
+ $row = $(this);
17
+ tallest = 0;
18
+ collapsed = false;
19
+ $(this).children('*').each(function(i) {
20
+ $(this).css('min-height', '1px');
21
+ collapsed = $(this).outerWidth() === $row.outerWidth();
22
+ if (!collapsed) {
23
+ if (!$(this).hasClass('equal')) {
24
+ $(this).addClass('equal');
25
+ }
26
+ if ($(this).outerHeight() > tallest) {
27
+ return tallest = $(this).outerHeight();
28
+ }
27
29
  }
30
+ });
31
+ if (!collapsed) {
32
+ return $(this).children('*').css('min-height', tallest);
28
33
  }
29
34
  });
30
- if (!collapsed) {
31
- return $(this).children('*').css('min-height', tallest);
32
- }
33
- });
34
- };
35
+ };
36
+
37
+ }).call(this);
@@ -1,7 +1,6 @@
1
- // Generated by CoffeeScript 1.6.1
2
-
3
- $(function() {
4
- $('body').on('click', '\
1
+ (function() {
2
+ $(function() {
3
+ $('body').on('click', '\
5
4
  .error input, \
6
5
  .error textarea, \
7
6
  .invalid input, \
@@ -10,20 +9,22 @@ $(function() {
10
9
  textarea.error, \
11
10
  input.invalid, \
12
11
  textarea.invalid', function(e) {
13
- return $(this).focus().select();
14
- });
15
- $('span.select select').each(function() {
16
- if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
17
- return $(this).addClass('unselected');
18
- } else {
19
- return $(this).removeClass('unselected');
20
- }
12
+ return $(this).focus().select();
13
+ });
14
+ $('span.select select').each(function() {
15
+ if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
16
+ return $(this).addClass('unselected');
17
+ } else {
18
+ return $(this).removeClass('unselected');
19
+ }
20
+ });
21
+ $('body').on('change', 'span.select select', function(e) {
22
+ if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
23
+ return $(this).addClass('unselected');
24
+ } else {
25
+ return $(this).removeClass('unselected');
26
+ }
27
+ });
21
28
  });
22
- $('body').on('change', 'span.select select', function(e) {
23
- if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
24
- return $(this).addClass('unselected');
25
- } else {
26
- return $(this).removeClass('unselected');
27
- }
28
- });
29
- });
29
+
30
+ }).call(this);
@@ -1,85 +1,95 @@
1
- // Generated by CoffeeScript 1.6.1
1
+ (function() {
2
+ var navSelector;
2
3
 
3
- $(function() {
4
- var delay, openMenu,
5
- _this = this;
6
- delay = '';
7
- openMenu = function(target) {
8
- return $(target).parent('li.menu').toggleClass('on');
9
- };
10
- $('body').on('mouseenter', '.nav > ul > li.menu:not(.disabled)', function(e) {
11
- if ($(window).width() >= 768) {
12
- clearTimeout(delay);
13
- $('.nav > ul > li.menu.on').removeClass('on');
14
- return $(this).addClass('on');
15
- }
16
- });
17
- $('body').on('mouseleave', '.nav > ul > li.menu:not(.disabled)', function(e) {
18
- if ($(window).width() >= 768) {
19
- return delay = setTimeout((function() {
20
- return $('.nav > ul > li.menu.on').removeClass('on');
21
- }), 350);
22
- }
23
- });
24
- $('body').on('click', '.nav > ul > li.menu:not(.disabled) > a', function(e) {
25
- if (Modernizr.touch || $(window).width() < 768) {
4
+ if ($('.nav').size() > 0) {
5
+ navSelector = '.nav';
6
+ } else {
7
+ navSelector = 'nav';
8
+ }
9
+
10
+ $(function() {
11
+ var delay, openMenu,
12
+ _this = this;
13
+
14
+ delay = '';
15
+ openMenu = function(target) {
16
+ return $(target).parent('li.menu').toggleClass('on');
17
+ };
18
+ $('body').on('mouseenter', navSelector + ' > ul > li.menu:not(.disabled)', function(e) {
19
+ if ($(window).width() >= 768) {
20
+ clearTimeout(delay);
21
+ $(navSelector + ' > ul > li.menu.on').removeClass('on');
22
+ return $(this).addClass('on');
23
+ }
24
+ });
25
+ $('body').on('mouseleave', navSelector + ' > ul > li.menu:not(.disabled)', function(e) {
26
+ if ($(window).width() >= 768) {
27
+ return delay = setTimeout((function() {
28
+ return $(navSelector + ' > ul > li.menu.on').removeClass('on');
29
+ }), 350);
30
+ }
31
+ });
32
+ $('body').on('click', navSelector + ' > ul > li.menu:not(.disabled) > a', function(e) {
33
+ if (Modernizr.touch || $(window).width() < 768) {
34
+ openMenu(e.target);
35
+ } else {
36
+ $(navSelector + ' > ul > li.menu.on').removeClass('on');
37
+ $(e.target).parents('li.menu').addClass('on');
38
+ }
39
+ e.preventDefault();
40
+ return false;
41
+ });
42
+ $('body').on('focus', navSelector + ' > ul > li:not(.on) > a', function() {
43
+ return $(navSelector + ' > ul > li.menu.on').removeClass('on');
44
+ });
45
+ $('body').on('focus', navSelector + ' > ul > li.menu > a', function(e) {
26
46
  openMenu(e.target);
27
- } else {
28
- $('.nav > ul > li.menu.on').removeClass('on');
29
- $(e.target).parents('li.menu').addClass('on');
30
- }
31
- e.preventDefault();
32
- return false;
33
- });
34
- $('body').on('focus', '.nav > ul > li:not(.on) > a', function() {
35
- return $('.nav > ul > li.menu.on').removeClass('on');
36
- });
37
- $('body').on('focus', '.nav > ul > li.menu > a', function(e) {
38
- openMenu(e.target);
39
- e.preventDefault();
40
- return false;
41
- });
42
- $('body').on('click', function(e) {
43
- if ($(e.target).hasClass('dropdown')) {
44
- $(e.target).toggleClass('on');
45
- } else {
46
- if ($('.dropdown').filter('.on').length) {
47
- $('.dropdown').filter('.on').removeClass('on');
47
+ e.preventDefault();
48
+ return false;
49
+ });
50
+ $('body').on('click', function(e) {
51
+ if ($(e.target).hasClass('dropdown')) {
52
+ $(e.target).toggleClass('on');
53
+ } else {
54
+ if ($('.dropdown').filter('.on').length) {
55
+ $('.dropdown').filter('.on').removeClass('on');
56
+ }
48
57
  }
49
- }
50
- if ($('.nav > ul > li').filter('.menu.on').length) {
51
- return $('.nav > ul > li').filter('.menu.on').removeClass('on');
52
- }
53
- });
54
- $('body').on('focus', '.dropdown', function(e) {
55
- return $(this).addClass('on');
56
- });
57
- $('body').on('blur', '.dropdown li:last-child a', function(e) {
58
- return $('.dropdown').filter('.on').removeClass('on');
58
+ if ($(navSelector + ' > ul > li').filter('.menu.on').length) {
59
+ return $(navSelector + ' > ul > li').filter('.menu.on').removeClass('on');
60
+ }
61
+ });
62
+ $('body').on('focus', '.dropdown', function(e) {
63
+ return $(this).addClass('on');
64
+ });
65
+ $('body').on('blur', '.dropdown li:last-child a', function(e) {
66
+ return $('.dropdown').filter('.on').removeClass('on');
67
+ });
68
+ $(navSelector + '.menu').each(function() {
69
+ if (!$(this).attr('data-label')) {
70
+ $(this).attr('data-label', 'Menu');
71
+ }
72
+ if (!($(this).find('.menu-toggle').length > 0)) {
73
+ return $(this).prepend('<a href="#" class="menu-toggle"><i class="icon-reorder"></i></a>');
74
+ }
75
+ });
76
+ $('body').on('click', navSelector + '.menu .menu-toggle', function(e) {
77
+ $(this).parent(navSelector + '.menu').toggleClass('on');
78
+ e.preventDefault();
79
+ return false;
80
+ });
81
+ $('body').on('focus', '.menu-toggle', function(e) {
82
+ return $(e.target).parent(navSelector + '.menu').addClass('on');
83
+ });
84
+ $('body').on('blur', navSelector + '.menu > ul > li:last-child a', function(e) {
85
+ return $(navSelector + '.menu').filter('.on').removeClass('on');
86
+ });
59
87
  });
60
- $('.nav.menu').each(function() {
61
- if (!$(this).attr('data-label')) {
62
- $(this).attr('data-label', 'Menu');
63
- }
64
- if (!($(this).find('.menu-toggle').length > 0)) {
65
- return $(this).prepend('<a href="#" class="menu-toggle"><i class="icon-reorder"></i></a>');
88
+
89
+ $(window).on('resize', function() {
90
+ if ($(navSelector + ' > ul > li.menu.on').length > 1) {
91
+ return $(navSelector + ' > ul > li.menu.on').removeClass('on').first().addClass('on');
66
92
  }
67
93
  });
68
- $('body').on('click', '.nav.menu .menu-toggle', function(e) {
69
- $(this).parent('.nav.menu').toggleClass('on');
70
- e.preventDefault();
71
- return false;
72
- });
73
- $('body').on('focus', '.menu-toggle', function(e) {
74
- return $(e.target).parent('.nav.menu').addClass('on');
75
- });
76
- $('body').on('blur', '.nav.menu > ul > li:last-child a', function(e) {
77
- return $('.nav.menu').filter('.on').removeClass('on');
78
- });
79
- });
80
94
 
81
- $(window).on('resize', function() {
82
- if ($('.nav > ul > li.menu.on').length > 1) {
83
- return $('.nav > ul > li.menu.on').removeClass('on').first().addClass('on');
84
- }
85
- });
95
+ }).call(this);
@@ -1,8 +1,11 @@
1
- // Generated by CoffeeScript 1.6.1
2
1
  /*
3
2
  * Requires jquery.modals.js
4
3
  */
5
4
 
6
- $(function() {
7
- return $('div.modal, div[role=dialog]').modal();
8
- });
5
+
6
+ (function() {
7
+ $(function() {
8
+ return $('div.modal, div[role=dialog]').modal();
9
+ });
10
+
11
+ }).call(this);
@@ -1,98 +1,103 @@
1
- // Generated by CoffeeScript 1.6.1
2
- var limitPaginationItems;
1
+ (function() {
2
+ var limitPaginationItems;
3
3
 
4
- $(function() {
5
- limitPaginationItems();
6
- $('body').on('click', '.pagination ul > li:not(.next, .prev) a', function(e) {
7
- $('.pagination ul > li:not(.next, .prev)').removeClass('active');
8
- $(this).parent('li').addClass('active');
9
- if ($(this).parent('li').hasClass('first')) {
10
- $('.pagination ul > li.prev').addClass('disabled');
11
- } else {
12
- $('.pagination ul > li.prev').removeClass('disabled');
13
- }
14
- if ($(this).parent('li').hasClass('last')) {
15
- $('.pagination ul > li.next').addClass('disabled');
16
- } else {
17
- $('.pagination ul > li.next').removeClass('disabled');
18
- }
4
+ $(function() {
19
5
  limitPaginationItems();
20
- e.preventDefault();
21
- return false;
22
- });
23
- $('body').on('click', '.pagination ul > li.prev:not(.disabled)', function(e) {
24
- var el;
25
- $('.pagination ul > li.next').removeClass('disabled');
26
- el = $('.pagination ul > li.active');
27
- if (!el.hasClass('first')) {
28
- el.removeClass('active');
29
- el.prev().addClass('active');
30
- limitPaginationItems();
31
- }
32
- if ($('.pagination ul > li.active').hasClass('first')) {
33
- $(this).addClass('disabled');
34
- }
35
- e.preventDefault();
36
- return false;
37
- });
38
- $('body').on('click', '.pagination ul > li.next:not(.disabled)', function(e) {
39
- var el;
40
- $('.pagination ul > li.prev').removeClass('disabled');
41
- el = $('.pagination ul > li.active');
42
- if (!el.hasClass('last')) {
43
- el.removeClass('active');
44
- el.next().addClass('active');
6
+ $('body').on('click', '.pagination ul > li:not(.next, .prev) a', function(e) {
7
+ $('.pagination ul > li:not(.next, .prev)').removeClass('active');
8
+ $(this).parent('li').addClass('active');
9
+ if ($(this).parent('li').hasClass('first')) {
10
+ $('.pagination ul > li.prev').addClass('disabled');
11
+ } else {
12
+ $('.pagination ul > li.prev').removeClass('disabled');
13
+ }
14
+ if ($(this).parent('li').hasClass('last')) {
15
+ $('.pagination ul > li.next').addClass('disabled');
16
+ } else {
17
+ $('.pagination ul > li.next').removeClass('disabled');
18
+ }
45
19
  limitPaginationItems();
46
- }
47
- if ($('.pagination ul > li.active').hasClass('last')) {
48
- $(this).addClass('disabled');
49
- }
50
- e.preventDefault();
51
- return false;
52
- });
53
- $('body').on('click', '.pagination ul > li.disabled a', function(e) {
54
- e.preventDefault();
55
- return false;
56
- });
57
- });
20
+ e.preventDefault();
21
+ return false;
22
+ });
23
+ $('body').on('click', '.pagination ul > li.prev:not(.disabled)', function(e) {
24
+ var el;
58
25
 
59
- $(window).resize(function() {
60
- return limitPaginationItems();
61
- });
26
+ $('.pagination ul > li.next').removeClass('disabled');
27
+ el = $('.pagination ul > li.active');
28
+ if (!el.hasClass('first')) {
29
+ el.removeClass('active');
30
+ el.prev().addClass('active');
31
+ limitPaginationItems();
32
+ }
33
+ if ($('.pagination ul > li.active').hasClass('first')) {
34
+ $(this).addClass('disabled');
35
+ }
36
+ e.preventDefault();
37
+ return false;
38
+ });
39
+ $('body').on('click', '.pagination ul > li.next:not(.disabled)', function(e) {
40
+ var el;
62
41
 
63
- limitPaginationItems = function() {
64
- return $('.pagination ul').each(function() {
65
- var pagination, totalItemsWidth, visibleItemsWidth, visibleSpace, _results;
66
- pagination = $(this);
67
- visibleSpace = pagination.outerWidth() - pagination.children('li.prev').outerWidth() - pagination.children('li.next').outerWidth();
68
- totalItemsWidth = 0;
69
- pagination.children('li').each(function() {
70
- return totalItemsWidth += $(this).outerWidth();
42
+ $('.pagination ul > li.prev').removeClass('disabled');
43
+ el = $('.pagination ul > li.active');
44
+ if (!el.hasClass('last')) {
45
+ el.removeClass('active');
46
+ el.next().addClass('active');
47
+ limitPaginationItems();
48
+ }
49
+ if ($('.pagination ul > li.active').hasClass('last')) {
50
+ $(this).addClass('disabled');
51
+ }
52
+ e.preventDefault();
53
+ return false;
71
54
  });
72
- pagination.children('li').not('.prev, .next, .active').hide();
73
- visibleItemsWidth = 0;
74
- pagination.children('li:visible').each(function() {
75
- return visibleItemsWidth += $(this).outerWidth();
55
+ $('body').on('click', '.pagination ul > li.disabled a', function(e) {
56
+ e.preventDefault();
57
+ return false;
76
58
  });
77
- _results = [];
78
- while ((visibleItemsWidth + 29) < visibleSpace && (visibleItemsWidth + 29) < totalItemsWidth) {
79
- pagination.children('li:visible').not('.next').last().next().show();
59
+ });
60
+
61
+ $(window).resize(function() {
62
+ return limitPaginationItems();
63
+ });
64
+
65
+ limitPaginationItems = function() {
66
+ return $('.pagination ul').each(function() {
67
+ var pagination, totalItemsWidth, visibleItemsWidth, visibleSpace, _results;
68
+
69
+ pagination = $(this);
70
+ visibleSpace = pagination.outerWidth() - pagination.children('li.prev').outerWidth() - pagination.children('li.next').outerWidth();
71
+ totalItemsWidth = 0;
72
+ pagination.children('li').each(function() {
73
+ return totalItemsWidth += $(this).outerWidth();
74
+ });
75
+ pagination.children('li').not('.prev, .next, .active').hide();
80
76
  visibleItemsWidth = 0;
81
77
  pagination.children('li:visible').each(function() {
82
78
  return visibleItemsWidth += $(this).outerWidth();
83
79
  });
84
- if ((visibleItemsWidth + 29) <= visibleSpace) {
85
- pagination.children('li:visible').not('.prev').first().prev().show();
80
+ _results = [];
81
+ while ((visibleItemsWidth + 29) < visibleSpace && (visibleItemsWidth + 29) < totalItemsWidth) {
82
+ pagination.children('li:visible').not('.next').last().next().show();
86
83
  visibleItemsWidth = 0;
87
84
  pagination.children('li:visible').each(function() {
88
85
  return visibleItemsWidth += $(this).outerWidth();
89
86
  });
87
+ if ((visibleItemsWidth + 29) <= visibleSpace) {
88
+ pagination.children('li:visible').not('.prev').first().prev().show();
89
+ visibleItemsWidth = 0;
90
+ pagination.children('li:visible').each(function() {
91
+ return visibleItemsWidth += $(this).outerWidth();
92
+ });
93
+ }
94
+ visibleItemsWidth = 0;
95
+ _results.push(pagination.children('li:visible').each(function() {
96
+ return visibleItemsWidth += $(this).outerWidth();
97
+ }));
90
98
  }
91
- visibleItemsWidth = 0;
92
- _results.push(pagination.children('li:visible').each(function() {
93
- return visibleItemsWidth += $(this).outerWidth();
94
- }));
95
- }
96
- return _results;
97
- });
98
- };
99
+ return _results;
100
+ });
101
+ };
102
+
103
+ }).call(this);