materialize-sass 0.97.6 → 0.97.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/app/assets/javascripts/materialize-sprockets.js +1 -4
- data/app/assets/javascripts/materialize.js +887 -338
- data/app/assets/javascripts/materialize.min.js +5 -5
- data/app/assets/javascripts/materialize/animation.js +0 -0
- data/app/assets/javascripts/materialize/buttons.js +0 -0
- data/app/assets/javascripts/materialize/cards.js +0 -3
- data/app/assets/javascripts/materialize/carousel.js +150 -46
- data/app/assets/javascripts/materialize/character_counter.js +0 -0
- data/app/assets/javascripts/materialize/chips.js +262 -4
- data/app/assets/javascripts/materialize/collapsible.js +0 -0
- data/app/assets/javascripts/materialize/date_picker/picker.date.js +0 -0
- data/app/assets/javascripts/materialize/date_picker/picker.js +0 -0
- data/app/assets/javascripts/materialize/dropdown.js +206 -178
- data/app/assets/javascripts/materialize/extras/nouislider.js +0 -0
- data/app/assets/javascripts/materialize/extras/nouislider.min.js +0 -0
- data/app/assets/javascripts/materialize/forms.js +94 -9
- data/app/assets/javascripts/materialize/global.js +0 -0
- data/app/assets/javascripts/materialize/hammer.min.js +0 -0
- data/app/assets/javascripts/materialize/init.js +21 -3
- data/app/assets/javascripts/materialize/initial.js +0 -0
- data/app/assets/javascripts/materialize/jquery.easing.1.3.js +0 -0
- data/app/assets/javascripts/materialize/jquery.timeago.min.js +0 -0
- data/app/assets/javascripts/materialize/leanModal.js +11 -10
- data/app/assets/javascripts/materialize/materialbox.js +0 -0
- data/app/assets/javascripts/materialize/parallax.js +0 -0
- data/app/assets/javascripts/materialize/prism.js +0 -0
- data/app/assets/javascripts/materialize/pushpin.js +15 -1
- data/app/assets/javascripts/materialize/scrollFire.js +2 -2
- data/app/assets/javascripts/materialize/scrollspy.js +7 -8
- data/app/assets/javascripts/materialize/sideNav.js +15 -7
- data/app/assets/javascripts/materialize/slider.js +1 -1
- data/app/assets/javascripts/materialize/tabs.js +15 -2
- data/app/assets/javascripts/materialize/toasts.js +0 -0
- data/app/assets/javascripts/materialize/tooltip.js +86 -59
- data/app/assets/javascripts/materialize/transitions.js +20 -5
- data/app/assets/javascripts/materialize/velocity.min.js +0 -0
- data/app/assets/javascripts/materialize/waves.js +0 -0
- data/app/assets/stylesheets/materialize/components/_buttons.scss +15 -1
- data/app/assets/stylesheets/materialize/components/_cards.scss +54 -7
- data/app/assets/stylesheets/materialize/components/_carousel.scss +60 -9
- data/app/assets/stylesheets/materialize/components/_chips.scss +49 -2
- data/app/assets/stylesheets/materialize/components/_collapsible.scss +3 -3
- data/app/assets/stylesheets/materialize/components/_color.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_global.scss +7 -8
- data/app/assets/stylesheets/materialize/components/_grid.scss +1 -0
- data/app/assets/stylesheets/materialize/components/_navbar.scss +15 -4
- data/app/assets/stylesheets/materialize/components/_sideNav.scss +93 -8
- data/app/assets/stylesheets/materialize/components/_tooltip.scss +20 -22
- data/app/assets/stylesheets/materialize/components/_variables.scss +11 -7
- data/app/assets/stylesheets/materialize/components/_waves.scss +5 -1
- data/app/assets/stylesheets/materialize/components/forms/_checkboxes.scss +0 -0
- data/app/assets/stylesheets/materialize/components/forms/_file-input.scss +0 -0
- data/app/assets/stylesheets/materialize/components/forms/_forms.scss +0 -0
- data/app/assets/stylesheets/materialize/components/forms/_input-fields.scss +23 -4
- data/app/assets/stylesheets/materialize/components/forms/_radio-buttons.scss +0 -0
- data/app/assets/stylesheets/materialize/components/forms/_range.scss +0 -0
- data/app/assets/stylesheets/materialize/components/forms/_select.scss +0 -0
- data/app/assets/stylesheets/materialize/components/forms/_switches.scss +0 -0
- data/app/assets/stylesheets/materialize/extras/nouislider.css +0 -0
- data/lib/materialize-sass/version.rb +1 -1
- metadata +3 -3
File without changes
|
File without changes
|
@@ -29,14 +29,12 @@
|
|
29
29
|
});
|
30
30
|
});
|
31
31
|
|
32
|
-
|
33
32
|
// Floating-Fixed table of contents
|
34
|
-
|
35
33
|
setTimeout(function() {
|
36
34
|
var tocWrapperHeight = 260; // Max height of ads.
|
37
35
|
var tocHeight = $('.toc-wrapper .table-of-contents').length ? $('.toc-wrapper .table-of-contents').height() : 0;
|
38
36
|
var socialHeight = 95; // Height of unloaded social media in footer.
|
39
|
-
var footerOffset = $('footer').first().length ? $('footer').first().offset().top : 0;
|
37
|
+
var footerOffset = $('body > footer').first().length ? $('body > footer').first().offset().top : 0;
|
40
38
|
var bottomOffset = footerOffset - socialHeight - tocHeight - tocWrapperHeight;
|
41
39
|
|
42
40
|
if ($('nav').length) {
|
@@ -149,7 +147,27 @@
|
|
149
147
|
$('.button-collapse').sideNav({'edge': 'left'});
|
150
148
|
$('.datepicker').pickadate({selectYears: 20});
|
151
149
|
$('select').not('.disabled').material_select();
|
150
|
+
$('input.autocomplete').autocomplete({
|
151
|
+
data: {"Apple": null, "Microsoft": null, "Google": 'http://placehold.it/250x250'}
|
152
|
+
});
|
153
|
+
|
154
|
+
$('.chips-initial').material_chip({
|
155
|
+
readOnly: true,
|
156
|
+
data: [{
|
157
|
+
tag: 'Apple',
|
158
|
+
}, {
|
159
|
+
tag: 'Microsoft',
|
160
|
+
}, {
|
161
|
+
tag: 'Google',
|
162
|
+
}]
|
163
|
+
});
|
164
|
+
|
165
|
+
$('.chips-placeholder').material_chip({
|
166
|
+
placeholder: 'Enter a tag',
|
167
|
+
secondaryPlaceholder: '+Tag',
|
168
|
+
});
|
152
169
|
|
170
|
+
$('.chips').material_chip();
|
153
171
|
|
154
172
|
}); // end of document ready
|
155
173
|
})(jQuery); // end of jQuery name space
|
File without changes
|
File without changes
|
File without changes
|
@@ -21,16 +21,17 @@
|
|
21
21
|
ready: undefined,
|
22
22
|
complete: undefined,
|
23
23
|
dismissible: true,
|
24
|
-
starting_top: '4%'
|
25
|
-
|
26
|
-
|
24
|
+
starting_top: '4%',
|
25
|
+
ending_top: '10%'
|
26
|
+
};
|
27
|
+
var $modal = $(this);
|
27
28
|
|
28
29
|
if ($modal.hasClass('open')) {
|
29
30
|
return;
|
30
31
|
}
|
31
32
|
|
32
|
-
overlayID = _generateID();
|
33
|
-
$overlay = $('<div class="lean-overlay"></div>');
|
33
|
+
var overlayID = _generateID();
|
34
|
+
var $overlay = $('<div class="lean-overlay"></div>');
|
34
35
|
lStack = (++_stack);
|
35
36
|
|
36
37
|
// Store a reference of the overlay
|
@@ -86,7 +87,7 @@
|
|
86
87
|
else {
|
87
88
|
$.Velocity.hook($modal, "scaleX", 0.7);
|
88
89
|
$modal.css({ top: options.starting_top });
|
89
|
-
$modal.velocity({top:
|
90
|
+
$modal.velocity({top: options.ending_top, opacity: 1, scaleX: '1'}, {
|
90
91
|
duration: options.in_duration,
|
91
92
|
queue: false,
|
92
93
|
ease: "easeOutCubic",
|
@@ -108,10 +109,10 @@
|
|
108
109
|
var defaults = {
|
109
110
|
out_duration: 250,
|
110
111
|
complete: undefined
|
111
|
-
}
|
112
|
-
$modal = $(this)
|
113
|
-
overlayID = $modal.data('overlay-id')
|
114
|
-
$overlay = $('#' + overlayID);
|
112
|
+
};
|
113
|
+
var $modal = $(this);
|
114
|
+
var overlayID = $modal.data('overlay-id');
|
115
|
+
var $overlay = $('#' + overlayID);
|
115
116
|
$modal.removeClass('open');
|
116
117
|
|
117
118
|
options = $.extend(defaults, options);
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,13 +1,26 @@
|
|
1
1
|
(function ($) {
|
2
2
|
$.fn.pushpin = function (options) {
|
3
|
-
|
3
|
+
// Defaults
|
4
4
|
var defaults = {
|
5
5
|
top: 0,
|
6
6
|
bottom: Infinity,
|
7
7
|
offset: 0
|
8
8
|
};
|
9
|
+
|
10
|
+
// Remove pushpin event and classes
|
11
|
+
if (options === "remove") {
|
12
|
+
this.each(function () {
|
13
|
+
if (id = $(this).data('pushpin-id')) {
|
14
|
+
$(window).off('scroll.' + id);
|
15
|
+
$(this).removeData('pushpin-id').removeClass('pin-top pinned pin-bottom').removeAttr('style');
|
16
|
+
}
|
17
|
+
});
|
18
|
+
return false;
|
19
|
+
}
|
20
|
+
|
9
21
|
options = $.extend(defaults, options);
|
10
22
|
|
23
|
+
|
11
24
|
$index = 0;
|
12
25
|
return this.each(function() {
|
13
26
|
var $uniqueId = Materialize.guid(),
|
@@ -45,6 +58,7 @@
|
|
45
58
|
});
|
46
59
|
}
|
47
60
|
|
61
|
+
$(this).data('pushpin-id', $uniqueId);
|
48
62
|
updateElements($this, $(window).scrollTop());
|
49
63
|
$(window).on('scroll.' + $uniqueId, function () {
|
50
64
|
var $scrolled = $(window).scrollTop() + options.offset;
|
@@ -31,10 +31,10 @@
|
|
31
31
|
if (windowScroll > (elementOffset + offset)) {
|
32
32
|
if (value.done !== true) {
|
33
33
|
if (typeof(callback) === 'function') {
|
34
|
-
callback.call(this);
|
34
|
+
callback.call(this, currentElement);
|
35
35
|
} else if (typeof(callback) === 'string') {
|
36
36
|
var callbackFunc = new Function(callback);
|
37
|
-
callbackFunc();
|
37
|
+
callbackFunc(currentElement);
|
38
38
|
}
|
39
39
|
value.done = true;
|
40
40
|
}
|
@@ -170,6 +170,12 @@
|
|
170
170
|
* @returns {jQuery}
|
171
171
|
*/
|
172
172
|
$.scrollSpy = function(selector, options) {
|
173
|
+
var defaults = {
|
174
|
+
throttle: 100,
|
175
|
+
scrollOffset: 200 // offset - 200 allows elements near bottom of page to scroll
|
176
|
+
};
|
177
|
+
options = $.extend(defaults, options);
|
178
|
+
|
173
179
|
var visible = [];
|
174
180
|
selector = $(selector);
|
175
181
|
selector.each(function(i, element) {
|
@@ -179,16 +185,9 @@
|
|
179
185
|
$('a[href="#' + $(element).attr('id') + '"]').click(function(e) {
|
180
186
|
e.preventDefault();
|
181
187
|
var offset = $(this.hash).offset().top + 1;
|
182
|
-
|
183
|
-
// offset - 200 allows elements near bottom of page to scroll
|
184
|
-
|
185
|
-
$('html, body').animate({ scrollTop: offset - 200 }, {duration: 400, queue: false, easing: 'easeOutCubic'});
|
186
|
-
|
188
|
+
$('html, body').animate({ scrollTop: offset - options.scrollOffset }, {duration: 400, queue: false, easing: 'easeOutCubic'});
|
187
189
|
});
|
188
190
|
});
|
189
|
-
options = options || {
|
190
|
-
throttle: 100
|
191
|
-
};
|
192
191
|
|
193
192
|
offset.top = options.offsetTop || 0;
|
194
193
|
offset.right = options.offsetRight || 0;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
var methods = {
|
4
4
|
init : function(options) {
|
5
5
|
var defaults = {
|
6
|
-
menuWidth:
|
6
|
+
menuWidth: 300,
|
7
7
|
edge: 'left',
|
8
8
|
closeOnClick: false
|
9
9
|
};
|
@@ -14,7 +14,7 @@
|
|
14
14
|
var menu_id = $("#"+ $this.attr('data-activates'));
|
15
15
|
|
16
16
|
// Set to width
|
17
|
-
if (options.menuWidth !=
|
17
|
+
if (options.menuWidth != 300) {
|
18
18
|
menu_id.css('width', options.menuWidth);
|
19
19
|
}
|
20
20
|
|
@@ -44,7 +44,7 @@
|
|
44
44
|
$(window).resize( function() {
|
45
45
|
if (window.innerWidth > 992) {
|
46
46
|
// Close menu if window is resized bigger than 992 and user has fixed sidenav
|
47
|
-
if ($('#sidenav-overlay').length
|
47
|
+
if ($('#sidenav-overlay').length !== 0 && menuOut) {
|
48
48
|
removeMenu(true);
|
49
49
|
}
|
50
50
|
else {
|
@@ -130,7 +130,9 @@
|
|
130
130
|
var menuOut = false;
|
131
131
|
|
132
132
|
dragTarget.on('click', function(){
|
133
|
-
|
133
|
+
if (menuOut) {
|
134
|
+
removeMenu();
|
135
|
+
}
|
134
136
|
});
|
135
137
|
|
136
138
|
dragTarget.hammer({
|
@@ -220,13 +222,14 @@
|
|
220
222
|
if (options.edge === 'left') {
|
221
223
|
// If velocityX <= 0.3 then the user is flinging the menu closed so ignore menuOut
|
222
224
|
if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {
|
223
|
-
|
225
|
+
// Return menu to open
|
226
|
+
if (leftPos !== 0) {
|
224
227
|
menu_id.velocity({'translateX': [0, leftPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
225
228
|
}
|
226
229
|
|
227
|
-
// menu_id.css({'translateX': 0});
|
228
230
|
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
229
231
|
dragTarget.css({width: '50%', right: 0, left: ''});
|
232
|
+
menuOut = true;
|
230
233
|
}
|
231
234
|
else if (!menuOut || velocityX > 0.3) {
|
232
235
|
// Enable Scrolling
|
@@ -245,9 +248,14 @@
|
|
245
248
|
}
|
246
249
|
else {
|
247
250
|
if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {
|
248
|
-
|
251
|
+
// Return menu to open
|
252
|
+
if (rightPos !== 0) {
|
253
|
+
menu_id.velocity({'translateX': [0, rightPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
254
|
+
}
|
255
|
+
|
249
256
|
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
250
257
|
dragTarget.css({width: '50%', right: '', left: 0});
|
258
|
+
menuOut = true;
|
251
259
|
}
|
252
260
|
else if (!menuOut || velocityX < -0.3) {
|
253
261
|
// Enable Scrolling
|
@@ -17,7 +17,7 @@
|
|
17
17
|
// which slide is active and its associated content
|
18
18
|
var $this = $(this);
|
19
19
|
var $slider = $this.find('ul.slides').first();
|
20
|
-
var $slides = $slider.find('li');
|
20
|
+
var $slides = $slider.find('> li');
|
21
21
|
var $active_index = $slider.find('.active').index();
|
22
22
|
var $active, $indicators, $interval;
|
23
23
|
if ($active_index != -1) { $active = $slides.eq($active_index); }
|
@@ -1,7 +1,12 @@
|
|
1
1
|
(function ($) {
|
2
2
|
|
3
3
|
var methods = {
|
4
|
-
init : function() {
|
4
|
+
init : function(options) {
|
5
|
+
var defaults = {
|
6
|
+
onShow: null
|
7
|
+
};
|
8
|
+
options = $.extend(defaults, options);
|
9
|
+
|
5
10
|
return this.each(function() {
|
6
11
|
|
7
12
|
// For each set of tabs, we want to keep track of
|
@@ -20,7 +25,7 @@
|
|
20
25
|
|
21
26
|
// If no match is found, use the first link or any with class 'active' as the initial active tab.
|
22
27
|
if ($active.length === 0) {
|
23
|
-
|
28
|
+
$active = $(this).find('li.tab a.active').first();
|
24
29
|
}
|
25
30
|
if ($active.length === 0) {
|
26
31
|
$active = $(this).find('li.tab a').first();
|
@@ -68,6 +73,11 @@
|
|
68
73
|
return;
|
69
74
|
}
|
70
75
|
|
76
|
+
// Act as regular link if target attribute is specified.
|
77
|
+
if (!!$(this).attr("target")) {
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
|
71
81
|
$tabs_width = $this.width();
|
72
82
|
$tab_width = Math.max($tabs_width, $this[0].scrollWidth) / $links.length;
|
73
83
|
|
@@ -94,6 +104,9 @@
|
|
94
104
|
|
95
105
|
if ($content !== undefined) {
|
96
106
|
$content.show();
|
107
|
+
if (typeof(options.onShow) === "function") {
|
108
|
+
options.onShow.call(this, $content);
|
109
|
+
}
|
97
110
|
}
|
98
111
|
|
99
112
|
// Update indicator
|
File without changes
|
@@ -1,16 +1,19 @@
|
|
1
1
|
(function ($) {
|
2
2
|
$.fn.tooltip = function (options) {
|
3
|
-
|
4
|
-
|
3
|
+
var timeout = null,
|
4
|
+
margin = 5;
|
5
5
|
|
6
6
|
// Defaults
|
7
7
|
var defaults = {
|
8
|
-
delay: 350
|
8
|
+
delay: 350,
|
9
|
+
tooltip: '',
|
10
|
+
position: 'bottom',
|
11
|
+
html: false
|
9
12
|
};
|
10
13
|
|
11
14
|
// Remove tooltip from the activator
|
12
15
|
if (options === "remove") {
|
13
|
-
this.each(function(){
|
16
|
+
this.each(function() {
|
14
17
|
$('#' + $(this).attr('data-tooltip-id')).remove();
|
15
18
|
$(this).off('mouseenter.tooltip mouseleave.tooltip');
|
16
19
|
});
|
@@ -19,53 +22,76 @@
|
|
19
22
|
|
20
23
|
options = $.extend(defaults, options);
|
21
24
|
|
22
|
-
|
23
|
-
return this.each(function(){
|
25
|
+
return this.each(function() {
|
24
26
|
var tooltipId = Materialize.guid();
|
25
27
|
var origin = $(this);
|
26
28
|
origin.attr('data-tooltip-id', tooltipId);
|
27
29
|
|
28
|
-
//
|
29
|
-
var
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
30
|
+
// Get attributes.
|
31
|
+
var allowHtml,
|
32
|
+
tooltipDelay,
|
33
|
+
tooltipPosition,
|
34
|
+
tooltipText,
|
35
|
+
tooltipEl,
|
36
|
+
backdrop;
|
37
|
+
var setAttributes = function() {
|
38
|
+
allowHtml = origin.attr('data-html') ? origin.attr('data-html') === 'true' : options.html;
|
39
|
+
tooltipDelay = origin.attr('data-delay');
|
40
|
+
tooltipDelay = (tooltipDelay === undefined || tooltipDelay === '') ?
|
41
|
+
options.delay : tooltipDelay;
|
42
|
+
tooltipPosition = origin.attr('data-position');
|
43
|
+
tooltipPosition = (tooltipPosition === undefined || tooltipPosition === '') ?
|
44
|
+
options.position : tooltipPosition;
|
45
|
+
tooltipText = origin.attr('data-tooltip');
|
46
|
+
tooltipText = (tooltipText === undefined || tooltipText === '') ?
|
47
|
+
options.tooltip : tooltipText;
|
48
|
+
};
|
49
|
+
setAttributes();
|
50
|
+
|
51
|
+
var renderTooltipEl = function() {
|
52
|
+
var tooltip = $('<div class="material-tooltip"></div>');
|
53
|
+
|
54
|
+
// Create Text span
|
55
|
+
if (allowHtml) {
|
56
|
+
tooltipText = $('<span></span>').html(tooltipText);
|
57
|
+
} else{
|
58
|
+
tooltipText = $('<span></span>').text(tooltipText);
|
59
|
+
}
|
60
|
+
|
61
|
+
// Create tooltip
|
62
|
+
tooltip.append(tooltipText)
|
63
|
+
.appendTo($('body'))
|
64
|
+
.attr('id', tooltipId);
|
65
|
+
|
66
|
+
// Create backdrop
|
67
|
+
backdrop = $('<div class="backdrop"></div>');
|
68
|
+
backdrop.appendTo(tooltip);
|
69
|
+
return tooltip;
|
70
|
+
};
|
71
|
+
tooltipEl = renderTooltipEl();
|
72
|
+
|
73
|
+
// Destroy previously binded events
|
74
|
+
origin.off('mouseenter.tooltip mouseleave.tooltip');
|
75
|
+
// Mouse In
|
76
|
+
var started = false, timeoutRef;
|
77
|
+
origin.on({'mouseenter.tooltip': function(e) {
|
78
|
+
var showTooltip = function() {
|
79
|
+
setAttributes();
|
52
80
|
started = true;
|
53
|
-
|
81
|
+
tooltipEl.velocity('stop');
|
54
82
|
backdrop.velocity('stop');
|
55
|
-
|
56
|
-
|
57
|
-
// Set Tooltip text
|
58
|
-
newTooltip.children('span').text(origin.attr('data-tooltip'));
|
83
|
+
tooltipEl.css({ display: 'block', left: '0px', top: '0px' });
|
59
84
|
|
60
85
|
// Tooltip positioning
|
61
86
|
var originWidth = origin.outerWidth();
|
62
87
|
var originHeight = origin.outerHeight();
|
63
|
-
|
64
|
-
var tooltipHeight =
|
65
|
-
var tooltipWidth =
|
88
|
+
|
89
|
+
var tooltipHeight = tooltipEl.outerHeight();
|
90
|
+
var tooltipWidth = tooltipEl.outerWidth();
|
66
91
|
var tooltipVerticalMovement = '0px';
|
67
92
|
var tooltipHorizontalMovement = '0px';
|
68
|
-
var
|
93
|
+
var scaleXFactor = 8;
|
94
|
+
var scaleYFactor = 8;
|
69
95
|
var targetTop, targetLeft, newCoordinates;
|
70
96
|
|
71
97
|
if (tooltipPosition === "top") {
|
@@ -76,8 +102,10 @@
|
|
76
102
|
|
77
103
|
tooltipVerticalMovement = '-10px';
|
78
104
|
backdrop.css({
|
105
|
+
bottom: 0,
|
106
|
+
left: 0,
|
79
107
|
borderRadius: '14px 14px 0 0',
|
80
|
-
transformOrigin: '50%
|
108
|
+
transformOrigin: '50% 100%',
|
81
109
|
marginTop: tooltipHeight,
|
82
110
|
marginLeft: (tooltipWidth/2) - (backdrop.width()/2)
|
83
111
|
});
|
@@ -90,6 +118,8 @@
|
|
90
118
|
|
91
119
|
tooltipHorizontalMovement = '-10px';
|
92
120
|
backdrop.css({
|
121
|
+
top: '-7px',
|
122
|
+
right: 0,
|
93
123
|
width: '14px',
|
94
124
|
height: '14px',
|
95
125
|
borderRadius: '14px 0 0 14px',
|
@@ -106,6 +136,8 @@
|
|
106
136
|
|
107
137
|
tooltipHorizontalMovement = '+10px';
|
108
138
|
backdrop.css({
|
139
|
+
top: '-7px',
|
140
|
+
left: 0,
|
109
141
|
width: '14px',
|
110
142
|
height: '14px',
|
111
143
|
borderRadius: '0 14px 14px 0',
|
@@ -121,35 +153,30 @@
|
|
121
153
|
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
|
122
154
|
tooltipVerticalMovement = '+10px';
|
123
155
|
backdrop.css({
|
156
|
+
top: 0,
|
157
|
+
left: 0,
|
124
158
|
marginLeft: (tooltipWidth/2) - (backdrop.width()/2)
|
125
159
|
});
|
126
160
|
}
|
127
161
|
|
128
162
|
// Set tooptip css placement
|
129
|
-
|
163
|
+
tooltipEl.css({
|
130
164
|
top: newCoordinates.y,
|
131
165
|
left: newCoordinates.x
|
132
166
|
});
|
133
167
|
|
134
168
|
// Calculate Scale to fill
|
135
|
-
|
136
|
-
|
137
|
-
scale_factor = 8;
|
138
|
-
}
|
139
|
-
if (tooltipPosition === "right" || tooltipPosition === "left") {
|
140
|
-
scale_factor = tooltipWidth / 10;
|
141
|
-
if (scale_factor < 6)
|
142
|
-
scale_factor = 6;
|
143
|
-
}
|
169
|
+
scaleXFactor = Math.SQRT2 * tooltipWidth / parseInt(backdrop.css('width'));
|
170
|
+
scaleYFactor = Math.SQRT2 * tooltipHeight / parseInt(backdrop.css('height'));
|
144
171
|
|
145
|
-
|
172
|
+
tooltipEl.velocity({ marginTop: tooltipVerticalMovement, marginLeft: tooltipHorizontalMovement}, { duration: 350, queue: false })
|
146
173
|
.velocity({opacity: 1}, {duration: 300, delay: 50, queue: false});
|
147
174
|
backdrop.css({ display: 'block' })
|
148
175
|
.velocity({opacity:1},{duration: 55, delay: 0, queue: false})
|
149
|
-
.velocity({
|
150
|
-
|
176
|
+
.velocity({scaleX: scaleXFactor, scaleY: scaleYFactor}, {duration: 300, delay: 0, queue: false, easing: 'easeInOutQuad'});
|
177
|
+
};
|
151
178
|
|
152
|
-
|
179
|
+
timeoutRef = setTimeout(showTooltip, tooltipDelay); // End Interval
|
153
180
|
|
154
181
|
// Mouse Out
|
155
182
|
},
|
@@ -160,15 +187,15 @@
|
|
160
187
|
|
161
188
|
// Animate back
|
162
189
|
setTimeout(function() {
|
163
|
-
if (started
|
164
|
-
|
190
|
+
if (started !== true) {
|
191
|
+
tooltipEl.velocity({
|
165
192
|
opacity: 0, marginTop: 0, marginLeft: 0}, { duration: 225, queue: false});
|
166
|
-
backdrop.velocity({opacity: 0,
|
193
|
+
backdrop.velocity({opacity: 0, scaleX: 1, scaleY: 1}, {
|
167
194
|
duration:225,
|
168
195
|
queue: false,
|
169
196
|
complete: function(){
|
170
197
|
backdrop.css('display', 'none');
|
171
|
-
|
198
|
+
tooltipEl.css('display', 'none');
|
172
199
|
started = false;}
|
173
200
|
});
|
174
201
|
}
|
@@ -179,7 +206,7 @@
|
|
179
206
|
};
|
180
207
|
|
181
208
|
var repositionWithinScreen = function(x, y, width, height) {
|
182
|
-
var newX = x
|
209
|
+
var newX = x;
|
183
210
|
var newY = y;
|
184
211
|
|
185
212
|
if (newX < 0) {
|