materialize-sass 0.97.8 → 0.98.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/app/assets/javascripts/materialize.js +5 -5
- data/app/assets/javascripts/materialize/animation.js +8 -9
- data/app/assets/javascripts/materialize/carousel.js +52 -25
- data/app/assets/javascripts/materialize/character_counter.js +2 -2
- data/app/assets/javascripts/materialize/chips.js +39 -10
- data/app/assets/javascripts/materialize/dropdown.js +12 -12
- data/app/assets/javascripts/materialize/extras/nouislider.js +1917 -1438
- data/app/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
- data/app/assets/javascripts/materialize/forms.js +131 -35
- data/app/assets/javascripts/materialize/global.js +55 -0
- data/app/assets/javascripts/materialize/init.js +41 -4
- data/app/assets/javascripts/materialize/jquery.hammer.js +0 -0
- data/app/assets/javascripts/materialize/materialbox.js +86 -77
- data/app/assets/javascripts/materialize/modal.js +12 -12
- data/app/assets/javascripts/materialize/parallax.js +48 -48
- data/app/assets/javascripts/materialize/scrollFire.js +40 -37
- data/app/assets/javascripts/materialize/scrollspy.js +2 -53
- data/app/assets/javascripts/materialize/sideNav.js +46 -40
- data/app/assets/javascripts/materialize/slider.js +15 -12
- data/app/assets/javascripts/materialize/tabs.js +104 -35
- data/app/assets/javascripts/materialize/toasts.js +122 -123
- data/app/assets/javascripts/materialize/tooltip.js +15 -13
- data/app/assets/javascripts/materialize/transitions.js +24 -24
- data/app/assets/stylesheets/materialize.scss +2 -0
- data/app/assets/stylesheets/materialize/components/_badges.scss +46 -0
- data/app/assets/stylesheets/materialize/components/_buttons.scss +29 -17
- data/app/assets/stylesheets/materialize/components/_cards.scss +9 -3
- data/app/assets/stylesheets/materialize/components/_carousel.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_collapsible.scss +3 -7
- data/app/assets/stylesheets/materialize/components/_global.scss +6 -62
- data/app/assets/stylesheets/materialize/components/_icons-material-design.scss +0 -0
- data/app/assets/stylesheets/materialize/components/_materialbox.scss +13 -12
- data/app/assets/stylesheets/materialize/components/_navbar.scss +26 -7
- data/app/assets/stylesheets/materialize/components/_prefixer.scss +0 -0
- data/app/assets/stylesheets/materialize/components/_sideNav.scss +8 -5
- data/app/assets/stylesheets/materialize/components/_table_of_contents.scss +2 -2
- data/app/assets/stylesheets/materialize/components/_tabs.scss +0 -0
- data/app/assets/stylesheets/materialize/components/_toast.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_tooltip.scss +2 -3
- data/app/assets/stylesheets/materialize/components/_transitions.scss +13 -0
- data/app/assets/stylesheets/materialize/components/_typography.scss +0 -0
- data/app/assets/stylesheets/materialize/components/_variables.scss +7 -1
- data/app/assets/stylesheets/materialize/components/_waves.scss +80 -143
- data/app/assets/stylesheets/materialize/components/date_picker/_default.date.scss +0 -0
- data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +0 -0
- data/app/assets/stylesheets/materialize/components/date_picker/_default.time.scss +0 -0
- data/app/assets/stylesheets/materialize/components/forms/_input-fields.scss +4 -4
- data/app/assets/stylesheets/materialize/extras/nouislider.css +263 -123
- data/lib/materialize-sass/version.rb +1 -1
- metadata +4 -2
@@ -10,13 +10,13 @@
|
|
10
10
|
init : function(options) {
|
11
11
|
var defaults = {
|
12
12
|
opacity: 0.5,
|
13
|
-
|
14
|
-
|
13
|
+
inDuration: 350,
|
14
|
+
outDuration: 250,
|
15
15
|
ready: undefined,
|
16
16
|
complete: undefined,
|
17
17
|
dismissible: true,
|
18
|
-
|
19
|
-
|
18
|
+
startingTop: '4%',
|
19
|
+
endingTop: '10%'
|
20
20
|
};
|
21
21
|
|
22
22
|
// Override defaults
|
@@ -40,12 +40,12 @@
|
|
40
40
|
$modal.find('.modal-close').off('click.close');
|
41
41
|
$(document).off('keyup.modal' + overlayID);
|
42
42
|
|
43
|
-
$overlay.velocity( { opacity: 0}, {duration: options.
|
43
|
+
$overlay.velocity( { opacity: 0}, {duration: options.outDuration, queue: false, ease: "easeOutQuart"});
|
44
44
|
|
45
45
|
|
46
46
|
// Define Bottom Sheet animation
|
47
47
|
var exitVelocityOptions = {
|
48
|
-
duration: options.
|
48
|
+
duration: options.outDuration,
|
49
49
|
queue: false,
|
50
50
|
ease: "easeOutCubic",
|
51
51
|
// Handle modal ready callback
|
@@ -65,7 +65,7 @@
|
|
65
65
|
}
|
66
66
|
else {
|
67
67
|
$modal.velocity(
|
68
|
-
{ top: options.
|
68
|
+
{ top: options.startingTop, opacity: 0, scaleX: 0.7},
|
69
69
|
exitVelocityOptions
|
70
70
|
);
|
71
71
|
}
|
@@ -115,12 +115,12 @@
|
|
115
115
|
opacity: 0
|
116
116
|
});
|
117
117
|
|
118
|
-
$overlay.velocity({opacity: options.opacity}, {duration: options.
|
118
|
+
$overlay.velocity({opacity: options.opacity}, {duration: options.inDuration, queue: false, ease: "easeOutCubic"});
|
119
119
|
$modal.data('associated-overlay', $overlay[0]);
|
120
120
|
|
121
121
|
// Define Bottom Sheet animation
|
122
122
|
var enterVelocityOptions = {
|
123
|
-
duration: options.
|
123
|
+
duration: options.inDuration,
|
124
124
|
queue: false,
|
125
125
|
ease: "easeOutCubic",
|
126
126
|
// Handle modal ready callback
|
@@ -135,8 +135,8 @@
|
|
135
135
|
}
|
136
136
|
else {
|
137
137
|
$.Velocity.hook($modal, "scaleX", 0.7);
|
138
|
-
$modal.css({ top: options.
|
139
|
-
$modal.velocity({top: options.
|
138
|
+
$modal.css({ top: options.startingTop });
|
139
|
+
$modal.velocity({top: options.endingTop, opacity: 1, scaleX: '1'}, enterVelocityOptions);
|
140
140
|
}
|
141
141
|
|
142
142
|
};
|
@@ -148,7 +148,7 @@
|
|
148
148
|
|
149
149
|
// Close Handlers
|
150
150
|
$(document).on('click.modalTrigger', 'a[href="#' + modal_id + '"], [data-target="' + modal_id + '"]', function(e) {
|
151
|
-
options.
|
151
|
+
options.startingTop = ($(this).offset().top - $(window).scrollTop()) /1.15;
|
152
152
|
openModal($(this));
|
153
153
|
e.preventDefault();
|
154
154
|
}); // done set on click
|
@@ -1,58 +1,58 @@
|
|
1
1
|
(function ($) {
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
35
|
-
|
3
|
+
$.fn.parallax = function () {
|
4
|
+
var window_width = $(window).width();
|
5
|
+
// Parallax Scripts
|
6
|
+
return this.each(function(i) {
|
7
|
+
var $this = $(this);
|
8
|
+
$this.addClass('parallax');
|
9
|
+
|
10
|
+
function updateParallax(initial) {
|
11
|
+
var container_height;
|
12
|
+
if (window_width < 601) {
|
13
|
+
container_height = ($this.height() > 0) ? $this.height() : $this.children("img").height();
|
14
|
+
}
|
15
|
+
else {
|
16
|
+
container_height = ($this.height() > 0) ? $this.height() : 500;
|
17
|
+
}
|
18
|
+
var $img = $this.children("img").first();
|
19
|
+
var img_height = $img.height();
|
20
|
+
var parallax_dist = img_height - container_height;
|
21
|
+
var bottom = $this.offset().top + container_height;
|
22
|
+
var top = $this.offset().top;
|
23
|
+
var scrollTop = $(window).scrollTop();
|
24
|
+
var windowHeight = window.innerHeight;
|
25
|
+
var windowBottom = scrollTop + windowHeight;
|
26
|
+
var percentScrolled = (windowBottom - top) / (container_height + windowHeight);
|
27
|
+
var parallax = Math.round((parallax_dist * percentScrolled));
|
28
|
+
|
29
|
+
if (initial) {
|
30
|
+
$img.css('display', 'block');
|
31
|
+
}
|
32
|
+
if ((bottom > scrollTop) && (top < (scrollTop + windowHeight))) {
|
33
|
+
$img.css('transform', "translate3D(-50%," + parallax + "px, 0)");
|
36
34
|
}
|
37
35
|
|
38
|
-
|
39
|
-
$this.children("img").one("load", function() {
|
40
|
-
updateParallax(true);
|
41
|
-
}).each(function() {
|
42
|
-
if (this.complete) $(this).trigger("load");
|
43
|
-
});
|
36
|
+
}
|
44
37
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
38
|
+
// Wait for image load
|
39
|
+
$this.children("img").one("load", function() {
|
40
|
+
updateParallax(true);
|
41
|
+
}).each(function() {
|
42
|
+
if (this.complete) $(this).trigger("load");
|
43
|
+
});
|
49
44
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
45
|
+
$(window).scroll(function() {
|
46
|
+
window_width = $(window).width();
|
47
|
+
updateParallax(false);
|
48
|
+
});
|
54
49
|
|
50
|
+
$(window).resize(function() {
|
51
|
+
window_width = $(window).width();
|
52
|
+
updateParallax(false);
|
55
53
|
});
|
56
54
|
|
57
|
-
};
|
55
|
+
});
|
56
|
+
|
57
|
+
};
|
58
58
|
}( jQuery ));
|
@@ -1,48 +1,51 @@
|
|
1
1
|
(function($) {
|
2
2
|
|
3
|
-
|
3
|
+
var scrollFireEventsHandled = false;
|
4
4
|
|
5
|
+
// Input: Array of JSON objects {selector, offset, callback}
|
5
6
|
Materialize.scrollFire = function(options) {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
var
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
var currentElement = document.querySelector(selector);
|
28
|
-
if ( currentElement !== null) {
|
29
|
-
var elementOffset = currentElement.getBoundingClientRect().top + window.pageYOffset;
|
30
|
-
|
31
|
-
if (windowScroll > (elementOffset + offset)) {
|
32
|
-
if (value.done !== true) {
|
33
|
-
if (typeof(callback) === 'function') {
|
34
|
-
callback.call(this, currentElement);
|
35
|
-
} else if (typeof(callback) === 'string') {
|
36
|
-
var callbackFunc = new Function(callback);
|
37
|
-
callbackFunc(currentElement);
|
38
|
-
}
|
39
|
-
value.done = true;
|
40
|
-
}
|
7
|
+
var onScroll = function() {
|
8
|
+
var windowScroll = window.pageYOffset + window.innerHeight;
|
9
|
+
|
10
|
+
for (var i = 0 ; i < options.length; i++) {
|
11
|
+
// Get options from each line
|
12
|
+
var value = options[i];
|
13
|
+
var selector = value.selector,
|
14
|
+
offset = value.offset,
|
15
|
+
callback = value.callback;
|
16
|
+
|
17
|
+
var currentElement = document.querySelector(selector);
|
18
|
+
if ( currentElement !== null) {
|
19
|
+
var elementOffset = currentElement.getBoundingClientRect().top + window.pageYOffset;
|
20
|
+
|
21
|
+
if (windowScroll > (elementOffset + offset)) {
|
22
|
+
if (value.done !== true) {
|
23
|
+
if (typeof(callback) === 'function') {
|
24
|
+
callback.call(this, currentElement);
|
25
|
+
} else if (typeof(callback) === 'string') {
|
26
|
+
var callbackFunc = new Function(callback);
|
27
|
+
callbackFunc(currentElement);
|
41
28
|
}
|
29
|
+
value.done = true;
|
42
30
|
}
|
43
31
|
}
|
32
|
+
}
|
44
33
|
}
|
45
|
-
}
|
34
|
+
};
|
35
|
+
|
36
|
+
|
37
|
+
var throttledScroll = Materialize.throttle(function() {
|
38
|
+
onScroll();
|
39
|
+
}, options.throttle || 100);
|
40
|
+
|
41
|
+
if (!scrollFireEventsHandled) {
|
42
|
+
window.addEventListener("scroll", throttledScroll);
|
43
|
+
window.addEventListener("resize", throttledScroll);
|
44
|
+
scrollFireEventsHandled = true;
|
45
|
+
}
|
46
|
+
|
47
|
+
// perform a scan once, after current execution context, and after dom is ready
|
48
|
+
setTimeout(throttledScroll, 0);
|
46
49
|
};
|
47
50
|
|
48
51
|
})(jQuery);
|
@@ -105,57 +105,6 @@
|
|
105
105
|
jWindow.trigger('scrollSpy:winSize');
|
106
106
|
}
|
107
107
|
|
108
|
-
/**
|
109
|
-
* Get time in ms
|
110
|
-
* @license https://raw.github.com/jashkenas/underscore/master/LICENSE
|
111
|
-
* @type {function}
|
112
|
-
* @return {number}
|
113
|
-
*/
|
114
|
-
var getTime = (Date.now || function () {
|
115
|
-
return new Date().getTime();
|
116
|
-
});
|
117
|
-
|
118
|
-
/**
|
119
|
-
* Returns a function, that, when invoked, will only be triggered at most once
|
120
|
-
* during a given window of time. Normally, the throttled function will run
|
121
|
-
* as much as it can, without ever going more than once per `wait` duration;
|
122
|
-
* but if you'd like to disable the execution on the leading edge, pass
|
123
|
-
* `{leading: false}`. To disable execution on the trailing edge, ditto.
|
124
|
-
* @license https://raw.github.com/jashkenas/underscore/master/LICENSE
|
125
|
-
* @param {function} func
|
126
|
-
* @param {number} wait
|
127
|
-
* @param {Object=} options
|
128
|
-
* @returns {Function}
|
129
|
-
*/
|
130
|
-
function throttle(func, wait, options) {
|
131
|
-
var context, args, result;
|
132
|
-
var timeout = null;
|
133
|
-
var previous = 0;
|
134
|
-
options || (options = {});
|
135
|
-
var later = function () {
|
136
|
-
previous = options.leading === false ? 0 : getTime();
|
137
|
-
timeout = null;
|
138
|
-
result = func.apply(context, args);
|
139
|
-
context = args = null;
|
140
|
-
};
|
141
|
-
return function () {
|
142
|
-
var now = getTime();
|
143
|
-
if (!previous && options.leading === false) previous = now;
|
144
|
-
var remaining = wait - (now - previous);
|
145
|
-
context = this;
|
146
|
-
args = arguments;
|
147
|
-
if (remaining <= 0) {
|
148
|
-
clearTimeout(timeout);
|
149
|
-
timeout = null;
|
150
|
-
previous = now;
|
151
|
-
result = func.apply(context, args);
|
152
|
-
context = args = null;
|
153
|
-
} else if (!timeout && options.trailing !== false) {
|
154
|
-
timeout = setTimeout(later, remaining);
|
155
|
-
}
|
156
|
-
return result;
|
157
|
-
};
|
158
|
-
};
|
159
108
|
|
160
109
|
/**
|
161
110
|
* Enables ScrollSpy using a selector
|
@@ -193,7 +142,7 @@
|
|
193
142
|
offset.bottom = options.offsetBottom || 0;
|
194
143
|
offset.left = options.offsetLeft || 0;
|
195
144
|
|
196
|
-
var throttledScroll = throttle(function() {
|
145
|
+
var throttledScroll = Materialize.throttle(function() {
|
197
146
|
onScroll(options.scrollOffset);
|
198
147
|
}, options.throttle || 100);
|
199
148
|
var readyScroll = function(){
|
@@ -263,7 +212,7 @@
|
|
263
212
|
options = options || {
|
264
213
|
throttle: 100
|
265
214
|
};
|
266
|
-
return jWindow.on('resize', throttle(onWinSize, options.throttle || 100));
|
215
|
+
return jWindow.on('resize', Materialize.throttle(onWinSize, options.throttle || 100));
|
267
216
|
};
|
268
217
|
|
269
218
|
/**
|
@@ -12,41 +12,47 @@
|
|
12
12
|
|
13
13
|
$(this).each(function(){
|
14
14
|
var $this = $(this);
|
15
|
-
var
|
15
|
+
var menuId = $this.attr('data-activates');
|
16
|
+
var menu = $("#"+ menuId);
|
16
17
|
|
17
18
|
// Set to width
|
18
19
|
if (options.menuWidth != 300) {
|
19
|
-
|
20
|
+
menu.css('width', options.menuWidth);
|
20
21
|
}
|
21
22
|
|
22
23
|
// Add Touch Area
|
23
|
-
var $dragTarget;
|
24
|
+
var $dragTarget = $('.drag-target[data-sidenav="' + menuId + '"]');
|
24
25
|
if (options.draggable) {
|
25
|
-
|
26
|
+
// Regenerate dragTarget
|
27
|
+
if ($dragTarget.length) {
|
28
|
+
$dragTarget.remove();
|
29
|
+
}
|
30
|
+
|
31
|
+
$dragTarget = $('<div class="drag-target"></div>').attr('data-sidenav', menuId);
|
26
32
|
$('body').append($dragTarget);
|
27
33
|
} else {
|
28
34
|
$dragTarget = $();
|
29
35
|
}
|
30
36
|
|
31
37
|
if (options.edge == 'left') {
|
32
|
-
|
38
|
+
menu.css('transform', 'translateX(-100%)');
|
33
39
|
$dragTarget.css({'left': 0}); // Add Touch Area
|
34
40
|
}
|
35
41
|
else {
|
36
|
-
|
42
|
+
menu.addClass('right-aligned') // Change text-alignment to right
|
37
43
|
.css('transform', 'translateX(100%)');
|
38
44
|
$dragTarget.css({'right': 0}); // Add Touch Area
|
39
45
|
}
|
40
46
|
|
41
47
|
// If fixed sidenav, bring menu out
|
42
|
-
if (
|
48
|
+
if (menu.hasClass('fixed')) {
|
43
49
|
if (window.innerWidth > 992) {
|
44
|
-
|
50
|
+
menu.css('transform', 'translateX(0)');
|
45
51
|
}
|
46
52
|
}
|
47
53
|
|
48
54
|
// Window resize to reset on large screens fixed
|
49
|
-
if (
|
55
|
+
if (menu.hasClass('fixed')) {
|
50
56
|
$(window).resize( function() {
|
51
57
|
if (window.innerWidth > 992) {
|
52
58
|
// Close menu if window is resized bigger than 992 and user has fixed sidenav
|
@@ -54,16 +60,16 @@
|
|
54
60
|
removeMenu(true);
|
55
61
|
}
|
56
62
|
else {
|
57
|
-
//
|
58
|
-
|
59
|
-
//
|
63
|
+
// menu.removeAttr('style');
|
64
|
+
menu.css('transform', 'translateX(0%)');
|
65
|
+
// menu.css('width', options.menuWidth);
|
60
66
|
}
|
61
67
|
}
|
62
68
|
else if (menuOut === false){
|
63
69
|
if (options.edge === 'left') {
|
64
|
-
|
70
|
+
menu.css('transform', 'translateX(-100%)');
|
65
71
|
} else {
|
66
|
-
|
72
|
+
menu.css('transform', 'translateX(100%)');
|
67
73
|
}
|
68
74
|
|
69
75
|
}
|
@@ -73,7 +79,7 @@
|
|
73
79
|
|
74
80
|
// if closeOnClick, then add close event for all a tags in side sideNav
|
75
81
|
if (options.closeOnClick === true) {
|
76
|
-
|
82
|
+
menu.on("click.itemclick", "a:not(.collapsible-header)", function(){
|
77
83
|
removeMenu();
|
78
84
|
});
|
79
85
|
}
|
@@ -95,7 +101,7 @@
|
|
95
101
|
if (options.edge === 'left') {
|
96
102
|
// Reset phantom div
|
97
103
|
$dragTarget.css({width: '', right: '', left: '0'});
|
98
|
-
|
104
|
+
menu.velocity(
|
99
105
|
{'translateX': '-100%'},
|
100
106
|
{ duration: 200,
|
101
107
|
queue: false,
|
@@ -103,8 +109,8 @@
|
|
103
109
|
complete: function() {
|
104
110
|
if (restoreNav === true) {
|
105
111
|
// Restore Fixed sidenav
|
106
|
-
|
107
|
-
|
112
|
+
menu.removeAttr('style');
|
113
|
+
menu.css('width', options.menuWidth);
|
108
114
|
}
|
109
115
|
}
|
110
116
|
|
@@ -113,7 +119,7 @@
|
|
113
119
|
else {
|
114
120
|
// Reset phantom div
|
115
121
|
$dragTarget.css({width: '', right: '0', left: ''});
|
116
|
-
|
122
|
+
menu.velocity(
|
117
123
|
{'translateX': '100%'},
|
118
124
|
{ duration: 200,
|
119
125
|
queue: false,
|
@@ -121,8 +127,8 @@
|
|
121
127
|
complete: function() {
|
122
128
|
if (restoreNav === true) {
|
123
129
|
// Restore Fixed sidenav
|
124
|
-
|
125
|
-
|
130
|
+
menu.removeAttr('style');
|
131
|
+
menu.css('width', options.menuWidth);
|
126
132
|
}
|
127
133
|
}
|
128
134
|
});
|
@@ -180,7 +186,7 @@
|
|
180
186
|
if (x < (options.menuWidth / 2)) { menuOut = false; }
|
181
187
|
// Right Direction
|
182
188
|
else if (x >= (options.menuWidth / 2)) { menuOut = true; }
|
183
|
-
|
189
|
+
menu.css('transform', 'translateX(' + (x - options.menuWidth) + 'px)');
|
184
190
|
}
|
185
191
|
else {
|
186
192
|
// Left Direction
|
@@ -196,7 +202,7 @@
|
|
196
202
|
rightPos = 0;
|
197
203
|
}
|
198
204
|
|
199
|
-
|
205
|
+
menu.css('transform', 'translateX(' + rightPos + 'px)');
|
200
206
|
}
|
201
207
|
|
202
208
|
|
@@ -233,7 +239,7 @@
|
|
233
239
|
if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {
|
234
240
|
// Return menu to open
|
235
241
|
if (leftPos !== 0) {
|
236
|
-
|
242
|
+
menu.velocity({'translateX': [0, leftPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
237
243
|
}
|
238
244
|
|
239
245
|
$overlay.velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
@@ -247,7 +253,7 @@
|
|
247
253
|
width: ''
|
248
254
|
});
|
249
255
|
// Slide menu closed
|
250
|
-
|
256
|
+
menu.velocity({'translateX': [-1 * options.menuWidth - 10, leftPos]}, {duration: 200, queue: false, easing: 'easeOutQuad'});
|
251
257
|
$overlay.velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
|
252
258
|
complete: function () {
|
253
259
|
$(this).remove();
|
@@ -259,7 +265,7 @@
|
|
259
265
|
if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {
|
260
266
|
// Return menu to open
|
261
267
|
if (rightPos !== 0) {
|
262
|
-
|
268
|
+
menu.velocity({'translateX': [0, rightPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
263
269
|
}
|
264
270
|
|
265
271
|
$overlay.velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
@@ -274,7 +280,7 @@
|
|
274
280
|
});
|
275
281
|
|
276
282
|
// Slide menu closed
|
277
|
-
|
283
|
+
menu.velocity({'translateX': [options.menuWidth + 10, rightPos]}, {duration: 200, queue: false, easing: 'easeOutQuad'});
|
278
284
|
$overlay.velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
|
279
285
|
complete: function () {
|
280
286
|
$(this).remove();
|
@@ -287,7 +293,7 @@
|
|
287
293
|
});
|
288
294
|
}
|
289
295
|
|
290
|
-
$this.click(function() {
|
296
|
+
$this.off('click.sidenav').on('click.sidenav', function() {
|
291
297
|
if (menuOut === true) {
|
292
298
|
menuOut = false;
|
293
299
|
panning = false;
|
@@ -307,11 +313,11 @@
|
|
307
313
|
|
308
314
|
if (options.edge === 'left') {
|
309
315
|
$dragTarget.css({width: '50%', right: 0, left: ''});
|
310
|
-
|
316
|
+
menu.velocity({'translateX': [0, -1 * options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
311
317
|
}
|
312
318
|
else {
|
313
319
|
$dragTarget.css({width: '50%', right: '', left: 0});
|
314
|
-
|
320
|
+
menu.velocity({'translateX': [0, options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
|
315
321
|
}
|
316
322
|
|
317
323
|
$overlay.css('opacity', 0)
|
@@ -357,14 +363,14 @@
|
|
357
363
|
};
|
358
364
|
|
359
365
|
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
366
|
+
$.fn.sideNav = function(methodOrOptions) {
|
367
|
+
if ( methods[methodOrOptions] ) {
|
368
|
+
return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
|
369
|
+
} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
|
370
|
+
// Default to "init"
|
371
|
+
return methods.init.apply( this, arguments );
|
372
|
+
} else {
|
373
|
+
$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.sideNav' );
|
374
|
+
}
|
375
|
+
}; // Plugin end
|
370
376
|
}( jQuery ));
|