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.
- data/lib/groundworkcss/rails/version.rb +1 -1
- data/lib/groundworkcss/rails/version.rb~ +1 -1
- data/vendor/assets/javascripts/groundworkcss/components/disabled.js +13 -12
- data/vendor/assets/javascripts/groundworkcss/components/equalizeColumns.js +31 -28
- data/vendor/assets/javascripts/groundworkcss/components/forms.js +21 -20
- data/vendor/assets/javascripts/groundworkcss/components/menus.js +88 -78
- data/vendor/assets/javascripts/groundworkcss/components/modals.js +7 -4
- data/vendor/assets/javascripts/groundworkcss/components/pagination.js +87 -82
- data/vendor/assets/javascripts/groundworkcss/components/responsiveTables.js +22 -18
- data/vendor/assets/javascripts/groundworkcss/components/responsiveText.js +38 -31
- data/vendor/assets/javascripts/groundworkcss/components/tabs.js +19 -17
- data/vendor/assets/javascripts/groundworkcss/components/tiles.js +24 -21
- data/vendor/assets/javascripts/groundworkcss/components/tooltips.js +7 -4
- data/vendor/assets/javascripts/groundworkcss/groundwork.all.js +974 -821
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-modals.js +193 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-popover.js +208 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-responsiveTables.js +64 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-responsiveText.js +46 -0
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery-tooltip.js +137 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/_settings.scss +149 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/base/_all.scss +11 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_animations.scss → base/_animations.scss} +7 -3
- data/vendor/assets/stylesheets/groundworkcss-scss/{_global.scss → base/_global.scss} +27 -10
- data/vendor/assets/stylesheets/groundworkcss-scss/{_grid.scss → base/_grid.scss} +5 -3
- data/vendor/assets/stylesheets/groundworkcss-scss/{_helpers.scss → base/_helpers.scss} +61 -18
- data/vendor/assets/stylesheets/groundworkcss-scss/{_reset.scss → base/_reset.scss} +36 -31
- data/vendor/assets/stylesheets/groundworkcss-scss/core/_all.scss +11 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_variables.scss → core/_constants.scss} +7 -58
- data/vendor/assets/stylesheets/groundworkcss-scss/core/_defaults.scss +150 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_mixins.scss → core/_mixins.scss} +6 -97
- data/vendor/assets/stylesheets/groundworkcss-scss/form/_all.scss +10 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_forms.scss → form/_forms.scss} +96 -80
- data/vendor/assets/stylesheets/groundworkcss-scss/form/_tiles.scss +100 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/groundwork-ie.scss +10 -8
- data/vendor/assets/stylesheets/groundworkcss-scss/groundwork.scss +12 -32
- data/vendor/assets/stylesheets/groundworkcss-scss/{_popovers.scss → misc/_all.scss} +3 -4
- data/vendor/assets/stylesheets/groundworkcss-scss/{_social-icons.scss → misc/_social-icons.scss} +4 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/nav/_all.scss +11 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/nav/_buttons.scss +328 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_navigation.scss → nav/_navigation.scss} +8 -5
- data/vendor/assets/stylesheets/groundworkcss-scss/nav/_tabs.scss +230 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/no-svg.scss +9 -7
- data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_all.scss +13 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_desktop.scss +26 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_helpers.scss +16 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_ipad.scss +28 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_mobile.scss +44 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/responsive/_small-tablet.scss +196 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/type/_all.scss +9 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_font-awesome.scss → type/_font-awesome.scss} +10 -2
- data/vendor/assets/stylesheets/groundworkcss-scss/{_typography.scss → type/_typography.scss} +172 -60
- data/vendor/assets/stylesheets/groundworkcss-scss/type/_webfonts.scss +28 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_ui-elements.scss → ui/_all.scss} +4 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/ui/_callouts.scss +117 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/ui/_messages.scss +111 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_modals.scss → ui/_modals.scss} +2 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/ui/_popovers.scss +81 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/ui/_tables.scss +142 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/{_tooltips.scss → ui/_tooltips.scss} +35 -0
- metadata +56 -40
- data/vendor/assets/stylesheets/groundworkcss-scss/_buttons.scss +0 -231
- data/vendor/assets/stylesheets/groundworkcss-scss/_callouts.scss +0 -74
- data/vendor/assets/stylesheets/groundworkcss-scss/_cycle.scss +0 -20
- data/vendor/assets/stylesheets/groundworkcss-scss/_messages.scss +0 -69
- data/vendor/assets/stylesheets/groundworkcss-scss/_mobile-reset.scss +0 -11
- data/vendor/assets/stylesheets/groundworkcss-scss/_responsive.scss +0 -246
- data/vendor/assets/stylesheets/groundworkcss-scss/_tables.scss +0 -85
- data/vendor/assets/stylesheets/groundworkcss-scss/_tabs.scss +0 -172
- data/vendor/assets/stylesheets/groundworkcss-scss/_tiles.scss +0 -198
- data/vendor/assets/stylesheets/groundworkcss-scss/_webfonts.scss +0 -19
@@ -1,13 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$(function() {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
2
|
-
var equalizeColumns;
|
1
|
+
(function() {
|
2
|
+
var equalizeColumns;
|
3
3
|
|
4
|
-
$(window).load(function() {
|
5
|
-
|
6
|
-
});
|
4
|
+
$(window).load(function() {
|
5
|
+
return equalizeColumns();
|
6
|
+
});
|
7
7
|
|
8
|
-
$(window).resize(function() {
|
9
|
-
|
10
|
-
});
|
8
|
+
$(window).resize(function() {
|
9
|
+
return equalizeColumns();
|
10
|
+
});
|
11
11
|
|
12
|
-
equalizeColumns = function() {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
$(this).
|
20
|
-
|
21
|
-
|
22
|
-
if (
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
});
|
34
|
-
};
|
35
|
+
};
|
36
|
+
|
37
|
+
}).call(this);
|
@@ -1,7 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$(
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
23
|
-
|
24
|
-
return $(this).addClass('unselected');
|
25
|
-
} else {
|
26
|
-
return $(this).removeClass('unselected');
|
27
|
-
}
|
28
|
-
});
|
29
|
-
});
|
29
|
+
|
30
|
+
}).call(this);
|
@@ -1,85 +1,95 @@
|
|
1
|
-
|
1
|
+
(function() {
|
2
|
+
var navSelector;
|
2
3
|
|
3
|
-
$(
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
51
|
-
|
52
|
-
}
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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
|
-
|
61
|
-
|
62
|
-
|
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
|
-
|
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
|
-
|
7
|
-
|
8
|
-
|
5
|
+
|
6
|
+
(function() {
|
7
|
+
$(function() {
|
8
|
+
return $('div.modal, div[role=dialog]').modal();
|
9
|
+
});
|
10
|
+
|
11
|
+
}).call(this);
|
@@ -1,98 +1,103 @@
|
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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
|
-
$(
|
60
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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
|
-
|
73
|
-
|
74
|
-
|
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
|
-
|
78
|
-
|
79
|
-
|
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
|
-
|
85
|
-
|
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
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
return _results;
|
97
|
-
});
|
98
|
-
};
|
99
|
+
return _results;
|
100
|
+
});
|
101
|
+
};
|
102
|
+
|
103
|
+
}).call(this);
|