groundworkcss-rails 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/generators/groundworkcss/layout/templates/_sidebar.html.erb +5 -5
- data/lib/groundworkcss/rails/version.rb +1 -1
- data/vendor/assets/javascripts/groundworkcss/components/responsiveText.js +19 -2
- data/vendor/assets/javascripts/groundworkcss/groundwork.all.js +754 -744
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery.modals.js +152 -158
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery.popover.js +170 -176
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery.responsiveTables.js +44 -50
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery.responsiveText.js +26 -32
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery.tooltip.js +111 -117
- data/vendor/assets/stylesheets/groundworkcss-scss/_buttons.scss +67 -16
- data/vendor/assets/stylesheets/groundworkcss-scss/_callouts.scss +21 -11
- data/vendor/assets/stylesheets/groundworkcss-scss/_font-awesome.scss +1 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/_forms.scss +4 -4
- data/vendor/assets/stylesheets/groundworkcss-scss/_messages.scss +20 -10
- data/vendor/assets/stylesheets/groundworkcss-scss/_typography.scss +2 -0
- data/vendor/assets/stylesheets/groundworkcss-scss/_variables.scss +30 -5
- data/vendor/assets/stylesheets/groundworkcss-scss/{groundwork.css.scss → groundwork.scss} +0 -0
- metadata +15 -22
- data/vendor/assets/fonts/groundworkcss/fontawesome.otf +0 -0
- data/vendor/assets/javascripts/groundworkcss/groundwork.js +0 -264
- data/vendor/assets/javascripts/groundworkcss/libs/html5shiv.js +0 -299
- data/vendor/assets/javascripts/groundworkcss/plugins/jquery.orbit-1.4.0.js +0 -919
- data/vendor/assets/stylesheets/groundworkcss-scss/_classes.scss +0 -143
- data/vendor/assets/stylesheets/groundworkcss-scss/_layout.scss +0 -78
- data/vendor/assets/stylesheets/groundworkcss-scss/_orbit.scss +0 -239
@@ -1,5 +1,4 @@
|
|
1
1
|
// Generated by CoffeeScript 1.6.1
|
2
|
-
|
3
2
|
/*
|
4
3
|
*
|
5
4
|
* jQuery Modals by Gary Hepting
|
@@ -7,182 +6,177 @@
|
|
7
6
|
*
|
8
7
|
*/
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
9
|
+
(function($) {
|
10
|
+
var elems, modals;
|
11
|
+
if ($('div#iframeModal').length < 1) {
|
12
|
+
$('body').append('<div class="iframe modal" id="iframeModal"><iframe marginheight="0" marginwidth="0" frameborder="0"></iframe></div>');
|
13
|
+
$('div#iframeModal').prepend('<i class="close icon-remove"></i>').prepend('<i class="fullscreen icon-resize-full"></i>');
|
14
|
+
}
|
15
|
+
$('a.modal').each(function() {
|
16
|
+
$(this).attr('data-url', $(this).attr('href'));
|
17
|
+
return $(this).attr('href', '#iframeModal');
|
18
|
+
});
|
19
|
+
$('a.modal').on("click", function(e) {
|
20
|
+
$('div#iframeModal iframe').replaceWith('<iframe marginheight="0" marginwidth="0" frameborder="0" width="100%" height="100%" src="' + $(this).attr('data-url') + '"></iframe>');
|
21
|
+
e.preventDefault();
|
22
|
+
return false;
|
23
|
+
});
|
24
|
+
elems = [];
|
25
|
+
$.fn.modal = function() {
|
26
|
+
this.each(function() {
|
27
|
+
var $this;
|
28
|
+
$(this).not('#iframeModal').wrapInner('<div class="modal-content"></div>');
|
29
|
+
$(this).prepend('<i class="close icon-remove"></i>').prepend('<i class="fullscreen icon-resize-full"></i>').appendTo('body');
|
30
|
+
$this = $(this);
|
31
|
+
return $('[href=#' + $(this).attr('id') + ']').on("click", function(e) {
|
32
|
+
modals.open($(this).attr('href'), $(this).hasClass('fullscreen'));
|
33
|
+
e.preventDefault();
|
34
|
+
return false;
|
35
|
+
});
|
22
36
|
});
|
23
|
-
$('
|
24
|
-
|
25
|
-
e.preventDefault();
|
26
|
-
return false;
|
37
|
+
$('div.modal .close').on("click", function() {
|
38
|
+
return modals.close();
|
27
39
|
});
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
return $('div.modal .fullscreen').on("click", function() {
|
41
|
+
return modals.fullscreen($(this).parent('div.modal'));
|
42
|
+
});
|
43
|
+
};
|
44
|
+
modals = (function() {
|
45
|
+
var close, fullscreen, open;
|
46
|
+
$('body').addClass('modal-ready');
|
47
|
+
if ($("#overlay").length < 1) {
|
48
|
+
$('body').append('<div id="overlay"></div>');
|
49
|
+
}
|
50
|
+
$('#overlay, div.modal .close').bind("click", function(e) {
|
51
|
+
return close();
|
52
|
+
});
|
53
|
+
open = function(elem, fullscreen) {
|
54
|
+
$(window).bind("keydown", function(e) {
|
55
|
+
var keyCode;
|
56
|
+
keyCode = (e.which ? e.which : e.keyCode);
|
57
|
+
if (keyCode === 27) {
|
58
|
+
return close();
|
59
|
+
}
|
46
60
|
});
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
61
|
+
$(elem).addClass("active");
|
62
|
+
if (!$(elem).hasClass('iframe')) {
|
63
|
+
$(elem).css({
|
64
|
+
width: 'auto',
|
65
|
+
height: 'auto'
|
66
|
+
});
|
67
|
+
$(elem).css({
|
68
|
+
height: $(elem).outerHeight()
|
69
|
+
});
|
53
70
|
}
|
54
|
-
$(
|
55
|
-
|
71
|
+
$(elem).css({
|
72
|
+
top: '50%',
|
73
|
+
left: '50%',
|
74
|
+
'margin-top': ($(elem).outerHeight() / -2) + 'px',
|
75
|
+
'margin-left': ($(elem).outerWidth() / -2) + 'px'
|
56
76
|
});
|
57
|
-
|
58
|
-
$(
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
77
|
+
setTimeout(function() {
|
78
|
+
return $('body').addClass("modal-active");
|
79
|
+
}, 0);
|
80
|
+
setTimeout(function() {
|
81
|
+
return $('body').removeClass('modal-ready');
|
82
|
+
}, 400);
|
83
|
+
if (fullscreen) {
|
84
|
+
modals.fullscreen(elem);
|
85
|
+
}
|
86
|
+
};
|
87
|
+
close = function() {
|
88
|
+
var modal;
|
89
|
+
modal = $('div.modal.active');
|
90
|
+
$(window).unbind("keydown");
|
91
|
+
$('body').removeClass("modal-active").addClass('modal-ready');
|
92
|
+
if (modal.hasClass('iframe')) {
|
93
|
+
$('div#iframeModal iframe').replaceWith('<iframe marginheight="0" marginwidth="0" frameborder="0"></iframe>');
|
94
|
+
modal.css({
|
95
|
+
width: '80%',
|
96
|
+
height: '80%'
|
64
97
|
});
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
height: 'auto'
|
70
|
-
});
|
71
|
-
$(elem).css({
|
72
|
-
height: $(elem).outerHeight()
|
73
|
-
});
|
74
|
-
}
|
75
|
-
$(elem).css({
|
76
|
-
top: '50%',
|
77
|
-
left: '50%',
|
78
|
-
'margin-top': ($(elem).outerHeight() / -2) + 'px',
|
79
|
-
'margin-left': ($(elem).outerWidth() / -2) + 'px'
|
98
|
+
} else {
|
99
|
+
modal.css({
|
100
|
+
width: 'auto',
|
101
|
+
height: 'auto'
|
80
102
|
});
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
$('
|
96
|
-
if (modal.hasClass('iframe')) {
|
97
|
-
$('div
|
98
|
-
modal.css({
|
103
|
+
}
|
104
|
+
modal.css({
|
105
|
+
top: '10%',
|
106
|
+
left: '10%',
|
107
|
+
'max-width': '80%',
|
108
|
+
'max-height': '80%',
|
109
|
+
'margin-top': 0,
|
110
|
+
'margin-left': 0
|
111
|
+
});
|
112
|
+
modal.removeClass("active").removeClass("fullscreen");
|
113
|
+
$('i.fullscreen', modal).removeClass('icon-resize-small').addClass('icon-resize-full');
|
114
|
+
};
|
115
|
+
fullscreen = function(elem) {
|
116
|
+
if ($('div.modal.active').hasClass('fullscreen')) {
|
117
|
+
$('div.modal i.fullscreen').removeClass('icon-resize-small').addClass('icon-resize-full');
|
118
|
+
if ($('div.modal.active').hasClass('iframe')) {
|
119
|
+
$('div.modal.active').css({
|
99
120
|
width: '80%',
|
100
121
|
height: '80%'
|
101
122
|
});
|
102
123
|
} else {
|
103
|
-
modal.css({
|
124
|
+
$('div.modal.active').css({
|
104
125
|
width: 'auto',
|
105
126
|
height: 'auto'
|
106
127
|
});
|
128
|
+
$('div.modal.active').css({
|
129
|
+
height: $('div.modal.active').outerHeight()
|
130
|
+
});
|
107
131
|
}
|
108
|
-
modal.css({
|
109
|
-
top: '10%',
|
110
|
-
left: '10%',
|
132
|
+
$('div.modal.active').removeClass('fullscreen').css({
|
111
133
|
'max-width': '80%',
|
112
|
-
'max-height': '80%'
|
134
|
+
'max-height': '80%'
|
135
|
+
});
|
136
|
+
$('div.modal.active').delay(100).css({
|
137
|
+
top: '50%',
|
138
|
+
left: '50%',
|
139
|
+
'margin-top': ($('div.modal.active').outerHeight() / -2) + 'px',
|
140
|
+
'margin-left': ($('div.modal.active').outerWidth() / -2) + 'px'
|
141
|
+
});
|
142
|
+
} else {
|
143
|
+
$('div.modal i.fullscreen').addClass('icon-resize-small').removeClass('icon-resize-full');
|
144
|
+
$('div.modal.active').addClass('fullscreen').css({
|
145
|
+
top: 0,
|
146
|
+
left: 0,
|
113
147
|
'margin-top': 0,
|
114
|
-
'margin-left': 0
|
148
|
+
'margin-left': 0,
|
149
|
+
width: '100%',
|
150
|
+
height: '100%',
|
151
|
+
'max-width': '100%',
|
152
|
+
'max-height': '100%'
|
115
153
|
});
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
$('div.modal.active').removeClass('fullscreen').css({
|
137
|
-
'max-width': '80%',
|
138
|
-
'max-height': '80%'
|
139
|
-
});
|
140
|
-
$('div.modal.active').delay(100).css({
|
141
|
-
top: '50%',
|
142
|
-
left: '50%',
|
143
|
-
'margin-top': ($('div.modal.active').outerHeight() / -2) + 'px',
|
144
|
-
'margin-left': ($('div.modal.active').outerWidth() / -2) + 'px'
|
154
|
+
}
|
155
|
+
};
|
156
|
+
return {
|
157
|
+
open: open,
|
158
|
+
close: close,
|
159
|
+
fullscreen: fullscreen
|
160
|
+
};
|
161
|
+
})();
|
162
|
+
return $(window).resize(function() {
|
163
|
+
return $('div.modal.active').each(function() {
|
164
|
+
if (!$(this).hasClass('fullscreen')) {
|
165
|
+
$(this).removeClass('active').css({
|
166
|
+
top: '50%',
|
167
|
+
left: '50%',
|
168
|
+
'margin-top': ($(this).outerHeight() / -2) + 'px',
|
169
|
+
'margin-left': ($(this).outerWidth() / -2) + 'px'
|
170
|
+
}).addClass('active');
|
171
|
+
if (!$(this).hasClass('iframe')) {
|
172
|
+
$(this).css({
|
173
|
+
height: 'auto'
|
145
174
|
});
|
146
|
-
|
147
|
-
|
148
|
-
$('div.modal.active').addClass('fullscreen').css({
|
149
|
-
top: 0,
|
150
|
-
left: 0,
|
151
|
-
'margin-top': 0,
|
152
|
-
'margin-left': 0,
|
153
|
-
width: '100%',
|
154
|
-
height: '100%',
|
155
|
-
'max-width': '100%',
|
156
|
-
'max-height': '100%'
|
175
|
+
return $(this).css({
|
176
|
+
height: $(this).outerHeight()
|
157
177
|
});
|
158
178
|
}
|
159
|
-
}
|
160
|
-
return {
|
161
|
-
open: open,
|
162
|
-
close: close,
|
163
|
-
fullscreen: fullscreen
|
164
|
-
};
|
165
|
-
})();
|
166
|
-
return $(window).resize(function() {
|
167
|
-
return $('div.modal.active').each(function() {
|
168
|
-
if (!$(this).hasClass('fullscreen')) {
|
169
|
-
$(this).removeClass('active').css({
|
170
|
-
top: '50%',
|
171
|
-
left: '50%',
|
172
|
-
'margin-top': ($(this).outerHeight() / -2) + 'px',
|
173
|
-
'margin-left': ($(this).outerWidth() / -2) + 'px'
|
174
|
-
}).addClass('active');
|
175
|
-
if (!$(this).hasClass('iframe')) {
|
176
|
-
$(this).css({
|
177
|
-
height: 'auto'
|
178
|
-
});
|
179
|
-
return $(this).css({
|
180
|
-
height: $(this).outerHeight()
|
181
|
-
});
|
182
|
-
}
|
183
|
-
}
|
184
|
-
});
|
179
|
+
}
|
185
180
|
});
|
186
|
-
})
|
187
|
-
|
188
|
-
}).call(this);
|
181
|
+
});
|
182
|
+
})(jQuery);
|
@@ -1,5 +1,4 @@
|
|
1
1
|
// Generated by CoffeeScript 1.6.1
|
2
|
-
|
3
2
|
/*
|
4
3
|
*
|
5
4
|
* jQuery Popovers by Gary Hepting - https://github.com/ghepting/jquery-popovers
|
@@ -10,197 +9,192 @@
|
|
10
9
|
*
|
11
10
|
*/
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
left: left = offset.left - win.scrollLeft(),
|
40
|
-
bottom: bottom = win.height() - top - el.outerHeight(),
|
41
|
-
right: right = win.width() - left - el.outerWidth()
|
42
|
-
};
|
12
|
+
(function($) {
|
13
|
+
return $.fn.popover = function(options) {
|
14
|
+
var closePopover, defaults, delayAdjust, delayHide, getElementPosition, popover, resetPopover, setPosition, showPopover, trigger;
|
15
|
+
defaults = {
|
16
|
+
hover: false,
|
17
|
+
click: true,
|
18
|
+
resize: true,
|
19
|
+
scroll: true,
|
20
|
+
topOffset: 0,
|
21
|
+
delay: 500,
|
22
|
+
speed: 100
|
23
|
+
};
|
24
|
+
options = $.extend(defaults, options);
|
25
|
+
popover = $('#popover');
|
26
|
+
delayHide = '';
|
27
|
+
delayAdjust = '';
|
28
|
+
trigger = '';
|
29
|
+
getElementPosition = function(el) {
|
30
|
+
var bottom, left, offset, right, top, win;
|
31
|
+
offset = el.offset();
|
32
|
+
win = $(window);
|
33
|
+
return {
|
34
|
+
top: top = offset.top - win.scrollTop(),
|
35
|
+
left: left = offset.left - win.scrollLeft(),
|
36
|
+
bottom: bottom = win.height() - top - el.outerHeight(),
|
37
|
+
right: right = win.width() - left - el.outerWidth()
|
43
38
|
};
|
44
|
-
|
39
|
+
};
|
40
|
+
resetPopover = function(resize) {
|
41
|
+
popover.css({
|
42
|
+
top: 'auto',
|
43
|
+
right: 'auto',
|
44
|
+
bottom: 'auto',
|
45
|
+
left: 'auto'
|
46
|
+
});
|
47
|
+
if (resize) {
|
45
48
|
popover.css({
|
46
|
-
|
47
|
-
right: 'auto',
|
48
|
-
bottom: 'auto',
|
49
|
-
left: 'auto'
|
49
|
+
width: 'auto'
|
50
50
|
});
|
51
|
+
}
|
52
|
+
popover.removeClass('top');
|
53
|
+
popover.removeClass('right');
|
54
|
+
popover.removeClass('bottom');
|
55
|
+
return popover.removeClass('left');
|
56
|
+
};
|
57
|
+
setPosition = function(trigger, skipAnimation, resize) {
|
58
|
+
var attrs, coords, height, width;
|
59
|
+
if (trigger) {
|
51
60
|
if (resize) {
|
52
|
-
|
53
|
-
|
54
|
-
|
61
|
+
resetPopover(true);
|
62
|
+
} else {
|
63
|
+
resetPopover();
|
55
64
|
}
|
56
|
-
|
57
|
-
popover.
|
58
|
-
|
59
|
-
return popover.removeClass('left');
|
60
|
-
};
|
61
|
-
setPosition = function(trigger, skipAnimation, resize) {
|
62
|
-
var attrs, coords, height, width;
|
63
|
-
if (trigger) {
|
64
|
-
if (resize) {
|
65
|
-
resetPopover(true);
|
66
|
-
} else {
|
67
|
-
resetPopover();
|
68
|
-
}
|
69
|
-
coords = getElementPosition(trigger);
|
70
|
-
if (popover.outerWidth() > ($(window).width() - 20)) {
|
71
|
-
popover.css('width', $(window).width() - 20);
|
72
|
-
}
|
73
|
-
popover.css('max-width', Math.min($(window).width() - parseInt($('body').css('padding-left')) - parseInt($('body').css('padding-right')), parseInt(popover.css('max-width'))));
|
74
|
-
width = popover.outerWidth();
|
75
|
-
height = popover.outerHeight();
|
76
|
-
attrs = {};
|
77
|
-
if (coords.left <= coords.right) {
|
78
|
-
popover.addClass('left');
|
79
|
-
attrs.left = coords.left;
|
80
|
-
} else {
|
81
|
-
popover.addClass('right');
|
82
|
-
attrs.right = coords.right;
|
83
|
-
}
|
84
|
-
if ((coords.top - options.topOffset) > (height + 20)) {
|
85
|
-
popover.addClass('top');
|
86
|
-
attrs.top = trigger.offset().top - height - 20;
|
87
|
-
} else {
|
88
|
-
popover.addClass('bottom');
|
89
|
-
attrs.top = trigger.offset().top + 15;
|
90
|
-
}
|
91
|
-
popover.css(attrs);
|
92
|
-
if (skipAnimation) {
|
93
|
-
return popover.css({
|
94
|
-
top: '+=10'
|
95
|
-
});
|
96
|
-
}
|
65
|
+
coords = getElementPosition(trigger);
|
66
|
+
if (popover.outerWidth() > ($(window).width() - 20)) {
|
67
|
+
popover.css('width', $(window).width() - 20);
|
97
68
|
}
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
trigger.addClass('popover-trigger');
|
69
|
+
popover.css('max-width', Math.min($(window).width() - parseInt($('body').css('padding-left')) - parseInt($('body').css('padding-right')), parseInt(popover.css('max-width'))));
|
70
|
+
width = popover.outerWidth();
|
71
|
+
height = popover.outerHeight();
|
72
|
+
attrs = {};
|
73
|
+
if (coords.left <= coords.right) {
|
74
|
+
popover.addClass('left');
|
75
|
+
attrs.left = coords.left;
|
76
|
+
} else {
|
77
|
+
popover.addClass('right');
|
78
|
+
attrs.right = coords.right;
|
109
79
|
}
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
80
|
+
if ((coords.top - options.topOffset) > (height + 20)) {
|
81
|
+
popover.addClass('top');
|
82
|
+
attrs.top = trigger.offset().top - height - 20;
|
83
|
+
} else {
|
84
|
+
popover.addClass('bottom');
|
85
|
+
attrs.top = trigger.offset().top + 15;
|
114
86
|
}
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
87
|
+
popover.css(attrs);
|
88
|
+
if (skipAnimation) {
|
89
|
+
return popover.css({
|
90
|
+
top: '+=10'
|
91
|
+
});
|
92
|
+
}
|
93
|
+
}
|
94
|
+
};
|
95
|
+
closePopover = function() {
|
96
|
+
$('.popover-trigger').removeClass('popover-trigger');
|
97
|
+
return popover.removeClass('sticky').remove();
|
98
|
+
};
|
99
|
+
showPopover = function(e) {
|
100
|
+
var tip;
|
101
|
+
trigger = $(e.target);
|
102
|
+
if (!trigger.hasClass('popover-trigger')) {
|
103
|
+
closePopover();
|
104
|
+
trigger.addClass('popover-trigger');
|
105
|
+
}
|
106
|
+
tip = $('#' + trigger.attr('data-content')).html();
|
107
|
+
popover = $("<div id=\"popover\"></div>");
|
108
|
+
if (!tip || tip === "") {
|
109
|
+
return false;
|
110
|
+
}
|
111
|
+
trigger.removeAttr("title");
|
112
|
+
popover.css("opacity", 0).html(tip).appendTo("body");
|
113
|
+
setPosition(trigger);
|
114
|
+
popover.animate({
|
115
|
+
top: "+=10",
|
116
|
+
opacity: 1
|
117
|
+
}, options.speed);
|
118
|
+
popover.bind("click", function(e) {
|
119
|
+
if (e.target.tagName !== 'a') {
|
120
|
+
popover.addClass('sticky');
|
133
121
|
e.stopPropagation();
|
134
122
|
e.preventDefault();
|
135
123
|
return false;
|
136
|
-
}
|
137
|
-
|
138
|
-
|
139
|
-
|
124
|
+
}
|
125
|
+
});
|
126
|
+
popover.find('.close').bind("click", function(e) {
|
127
|
+
$('.popover-trigger').removeClass('popover-trigger');
|
128
|
+
popover.removeClass('sticky').remove();
|
129
|
+
e.stopPropagation();
|
130
|
+
e.preventDefault();
|
131
|
+
return false;
|
132
|
+
});
|
133
|
+
return popover.bind({
|
134
|
+
mouseenter: function() {
|
135
|
+
return clearTimeout(delayHide);
|
136
|
+
},
|
137
|
+
mouseleave: function() {
|
138
|
+
if (!popover.hasClass('sticky')) {
|
139
|
+
return delayHide = setTimeout((function() {
|
140
|
+
$('.popover-trigger').removeClass('popover-trigger');
|
141
|
+
return popover.removeClass('sticky').remove();
|
142
|
+
}), 500);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
});
|
146
|
+
};
|
147
|
+
return this.each(function() {
|
148
|
+
var $this;
|
149
|
+
$this = $(this);
|
150
|
+
if (options.hover) {
|
151
|
+
$this.bind({
|
152
|
+
mouseenter: function(e) {
|
153
|
+
trigger = $(e.target);
|
154
|
+
clearTimeout(delayHide);
|
155
|
+
if (!$this.hasClass('popover-trigger') && !popover.hasClass('sticky')) {
|
156
|
+
return showPopover(e);
|
157
|
+
}
|
140
158
|
},
|
141
159
|
mouseleave: function() {
|
142
160
|
if (!popover.hasClass('sticky')) {
|
143
|
-
return delayHide = setTimeout(
|
144
|
-
|
145
|
-
|
146
|
-
}), 500);
|
161
|
+
return delayHide = setTimeout(function() {
|
162
|
+
return closePopover();
|
163
|
+
}, options.delay);
|
147
164
|
}
|
148
165
|
}
|
149
166
|
});
|
150
|
-
}
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
});
|
171
|
-
}
|
172
|
-
if (options.click) {
|
173
|
-
$this.bind("click", function(e) {
|
174
|
-
trigger = $(e.target);
|
175
|
-
if (!trigger.hasClass('popover-trigger')) {
|
176
|
-
closePopover();
|
177
|
-
showPopover(e);
|
178
|
-
}
|
179
|
-
popover.addClass('sticky');
|
180
|
-
e.preventDefault();
|
181
|
-
e.stopPropagation();
|
182
|
-
return false;
|
183
|
-
});
|
184
|
-
}
|
185
|
-
if (options.resize) {
|
186
|
-
$(window).resize(function() {
|
187
|
-
clearTimeout(delayAdjust);
|
188
|
-
return delayAdjust = setTimeout(function() {
|
189
|
-
return setPosition(trigger, true, true);
|
190
|
-
}, 100);
|
191
|
-
});
|
192
|
-
}
|
193
|
-
if (options.scroll) {
|
194
|
-
$(window).scroll(function() {
|
195
|
-
return setPosition(trigger, true);
|
196
|
-
});
|
197
|
-
}
|
198
|
-
return $('html, body').bind("click", function(e) {
|
199
|
-
$('.popover-trigger').removeClass('popover-trigger');
|
200
|
-
return popover.removeClass('sticky').remove();
|
167
|
+
}
|
168
|
+
if (options.click) {
|
169
|
+
$this.bind("click", function(e) {
|
170
|
+
trigger = $(e.target);
|
171
|
+
if (!trigger.hasClass('popover-trigger')) {
|
172
|
+
closePopover();
|
173
|
+
showPopover(e);
|
174
|
+
}
|
175
|
+
popover.addClass('sticky');
|
176
|
+
e.preventDefault();
|
177
|
+
e.stopPropagation();
|
178
|
+
return false;
|
179
|
+
});
|
180
|
+
}
|
181
|
+
if (options.resize) {
|
182
|
+
$(window).resize(function() {
|
183
|
+
clearTimeout(delayAdjust);
|
184
|
+
return delayAdjust = setTimeout(function() {
|
185
|
+
return setPosition(trigger, true, true);
|
186
|
+
}, 100);
|
201
187
|
});
|
188
|
+
}
|
189
|
+
if (options.scroll) {
|
190
|
+
$(window).scroll(function() {
|
191
|
+
return setPosition(trigger, true);
|
192
|
+
});
|
193
|
+
}
|
194
|
+
return $('html, body').bind("click", function(e) {
|
195
|
+
$('.popover-trigger').removeClass('popover-trigger');
|
196
|
+
return popover.removeClass('sticky').remove();
|
202
197
|
});
|
203
|
-
};
|
204
|
-
}
|
205
|
-
|
206
|
-
}).call(this);
|
198
|
+
});
|
199
|
+
};
|
200
|
+
})(jQuery);
|