materialize-sass 0.96.1 → 0.96.2
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/app/assets/fonts/material-design-icons/Material-Design-Icons.eot +0 -0
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.svg +760 -742
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.ttf +0 -0
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.woff +0 -0
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.woff2 +0 -0
- data/app/assets/javascripts/materialize.js +4 -6022
- data/app/assets/javascripts/materialize/cards.js +1 -1
- data/app/assets/javascripts/materialize/character_counter.js +1 -1
- data/app/assets/javascripts/materialize/collapsible.js +6 -6
- data/app/assets/javascripts/materialize/dropdown.js +10 -10
- data/app/assets/javascripts/materialize/forms.js +29 -19
- data/app/assets/javascripts/materialize/global.js +7 -2
- data/app/assets/javascripts/materialize/init.js +3 -4
- data/app/assets/javascripts/materialize/leanModal.js +56 -31
- data/app/assets/javascripts/materialize/materialbox.js +10 -10
- data/app/assets/javascripts/materialize/scrollFire.js +3 -28
- data/app/assets/javascripts/materialize/sideNav.js +31 -54
- data/app/assets/javascripts/materialize/slider.js +246 -200
- data/app/assets/javascripts/materialize/tabs.js +9 -2
- data/app/assets/javascripts/materialize/toasts.js +7 -3
- data/app/assets/javascripts/materialize/tooltip.js +7 -7
- data/app/assets/javascripts/materialize/transitions.js +2 -2
- data/app/assets/stylesheets/materialize/components/_buttons.scss +6 -0
- data/app/assets/stylesheets/materialize/components/_collapsible.scss +4 -7
- data/app/assets/stylesheets/materialize/components/_color.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_dropdown.scss +7 -5
- data/app/assets/stylesheets/materialize/components/_form.scss +43 -6
- data/app/assets/stylesheets/materialize/components/_global.scss +32 -25
- data/app/assets/stylesheets/materialize/components/_icons-material-design.scss +3231 -757
- data/app/assets/stylesheets/materialize/components/_modal.scss +7 -5
- data/app/assets/stylesheets/materialize/components/_navbar.scss +6 -5
- data/app/assets/stylesheets/materialize/components/_slider.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_tabs.scss +5 -0
- data/app/assets/stylesheets/materialize/components/_tooltip.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_typography.scss +1 -3
- data/app/assets/stylesheets/materialize/components/_variables.scss +2 -1
- data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +5 -5
- data/lib/materialize-sass/engine.rb +1 -1
- data/lib/materialize-sass/version.rb +1 -1
- metadata +3 -3
@@ -34,10 +34,10 @@
|
|
34
34
|
object.parent().removeClass('active');
|
35
35
|
}
|
36
36
|
if (object.parent().hasClass('active')){
|
37
|
-
object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '')}});
|
37
|
+
object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
|
38
38
|
}
|
39
39
|
else{
|
40
|
-
object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '')}});
|
40
|
+
object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
|
41
41
|
}
|
42
42
|
|
43
43
|
$panel_headers.not(object).removeClass('active').parent().removeClass('active');
|
@@ -48,7 +48,7 @@
|
|
48
48
|
queue: false,
|
49
49
|
complete:
|
50
50
|
function() {
|
51
|
-
$(this).css('height', '')
|
51
|
+
$(this).css('height', '');
|
52
52
|
}
|
53
53
|
});
|
54
54
|
}
|
@@ -62,10 +62,10 @@
|
|
62
62
|
object.parent().removeClass('active');
|
63
63
|
}
|
64
64
|
if (object.parent().hasClass('active')){
|
65
|
-
object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '')}});
|
65
|
+
object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
|
66
66
|
}
|
67
67
|
else{
|
68
|
-
object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '')}});
|
68
|
+
object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
|
69
69
|
}
|
70
70
|
}
|
71
71
|
|
@@ -95,7 +95,7 @@
|
|
95
95
|
|
96
96
|
|
97
97
|
|
98
|
-
if (options.accordion || collapsible_type
|
98
|
+
if (options.accordion || collapsible_type === "accordion" || collapsible_type === undefined) { // Handle Accordion
|
99
99
|
// Add click handler to only direct collapsible header children
|
100
100
|
$panel_headers = $this.find('> li > .collapsible-header');
|
101
101
|
$panel_headers.on('click.collapse', function (e) {
|
@@ -15,7 +15,7 @@
|
|
15
15
|
hover: false,
|
16
16
|
gutter: 0, // Spacing from edge
|
17
17
|
belowOrigin: false
|
18
|
-
}
|
18
|
+
};
|
19
19
|
|
20
20
|
this.each(function(){
|
21
21
|
var origin = $(this);
|
@@ -25,17 +25,17 @@
|
|
25
25
|
var activates = $("#"+ origin.attr('data-activates'));
|
26
26
|
|
27
27
|
function updateOptions() {
|
28
|
-
if (origin.data('induration')
|
28
|
+
if (origin.data('induration') !== undefined)
|
29
29
|
options.inDuration = origin.data('inDuration');
|
30
|
-
if (origin.data('outduration')
|
30
|
+
if (origin.data('outduration') !== undefined)
|
31
31
|
options.outDuration = origin.data('outDuration');
|
32
|
-
if (origin.data('constrainwidth')
|
32
|
+
if (origin.data('constrainwidth') !== undefined)
|
33
33
|
options.constrain_width = origin.data('constrainwidth');
|
34
|
-
if (origin.data('hover')
|
34
|
+
if (origin.data('hover') !== undefined)
|
35
35
|
options.hover = origin.data('hover');
|
36
|
-
if (origin.data('gutter')
|
36
|
+
if (origin.data('gutter') !== undefined)
|
37
37
|
options.gutter = origin.data('gutter');
|
38
|
-
if (origin.data('beloworigin')
|
38
|
+
if (origin.data('beloworigin') !== undefined)
|
39
39
|
options.belowOrigin = origin.data('beloworigin');
|
40
40
|
}
|
41
41
|
|
@@ -56,11 +56,11 @@
|
|
56
56
|
activates.addClass('active');
|
57
57
|
|
58
58
|
// Constrain width
|
59
|
-
if (options.constrain_width
|
59
|
+
if (options.constrain_width === true) {
|
60
60
|
activates.css('width', origin.outerWidth());
|
61
61
|
}
|
62
62
|
var offset = 0;
|
63
|
-
if (options.belowOrigin
|
63
|
+
if (options.belowOrigin === true) {
|
64
64
|
offset = origin.height();
|
65
65
|
}
|
66
66
|
|
@@ -110,7 +110,7 @@
|
|
110
110
|
origin.on('mouseenter', function(e){ // Mouse over
|
111
111
|
if (open === false) {
|
112
112
|
placeDropdown();
|
113
|
-
open = true
|
113
|
+
open = true;
|
114
114
|
}
|
115
115
|
});
|
116
116
|
origin.on('mouseleave', function(e){
|
@@ -5,14 +5,14 @@
|
|
5
5
|
Materialize.updateTextFields = function() {
|
6
6
|
var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
|
7
7
|
$(input_selector).each(function(index, element) {
|
8
|
-
if ($(element).val().length > 0 || $(this).attr('placeholder') !== undefined) {
|
8
|
+
if ($(element).val().length > 0 || $(this).attr('placeholder') !== undefined || $(element)[0].validity.badInput === true) {
|
9
9
|
$(this).siblings('label, i').addClass('active');
|
10
10
|
}
|
11
11
|
else {
|
12
12
|
$(this).siblings('label, i').removeClass('active');
|
13
13
|
}
|
14
14
|
});
|
15
|
-
}
|
15
|
+
};
|
16
16
|
|
17
17
|
// Text based inputs
|
18
18
|
var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
|
@@ -53,14 +53,15 @@
|
|
53
53
|
});
|
54
54
|
|
55
55
|
$(document).on('blur', input_selector, function () {
|
56
|
-
|
57
|
-
|
56
|
+
var $inputElement = $(this);
|
57
|
+
if ($inputElement.val().length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === undefined) {
|
58
|
+
$inputElement.siblings('label, i').removeClass('active');
|
58
59
|
}
|
59
|
-
validate_field($
|
60
|
+
validate_field($inputElement);
|
60
61
|
});
|
61
62
|
|
62
63
|
validate_field = function(object) {
|
63
|
-
if (object.val().length === 0) {
|
64
|
+
if (object.val().length === 0 && object[0].validity.badInput === false) {
|
64
65
|
if (object.hasClass('validate')) {
|
65
66
|
object.removeClass('valid');
|
66
67
|
object.removeClass('invalid');
|
@@ -78,7 +79,7 @@
|
|
78
79
|
}
|
79
80
|
}
|
80
81
|
}
|
81
|
-
}
|
82
|
+
};
|
82
83
|
|
83
84
|
|
84
85
|
// Textarea Auto Resize
|
@@ -90,10 +91,17 @@
|
|
90
91
|
var text_area_selector = '.materialize-textarea';
|
91
92
|
|
92
93
|
function textareaAutoResize($textarea) {
|
94
|
+
// Set fontsize of hiddenDiv
|
95
|
+
var fontSize = $textarea.css('font-size');
|
96
|
+
if (fontSize) {
|
97
|
+
hiddenDiv.css('font-size', fontSize);
|
98
|
+
}
|
99
|
+
|
93
100
|
hiddenDiv.text($textarea.val() + '\n');
|
94
101
|
var content = hiddenDiv.html().replace(/\n/g, '<br>');
|
95
102
|
hiddenDiv.html(content);
|
96
103
|
|
104
|
+
|
97
105
|
// When textarea is hidden, width goes crazy.
|
98
106
|
// Approximate with half of window size
|
99
107
|
|
@@ -240,11 +248,13 @@
|
|
240
248
|
wrapper.addClass($select.attr('class'));
|
241
249
|
var options = $('<ul id="select-options-' + uniqueID+'" class="dropdown-content select-dropdown"></ul>');
|
242
250
|
var selectOptions = $select.children('option');
|
251
|
+
|
252
|
+
var label;
|
243
253
|
if ($select.find('option:selected') !== undefined) {
|
244
|
-
|
254
|
+
label = $select.find('option:selected');
|
245
255
|
}
|
246
256
|
else {
|
247
|
-
|
257
|
+
label = options.first();
|
248
258
|
}
|
249
259
|
|
250
260
|
|
@@ -313,36 +323,36 @@
|
|
313
323
|
collection.find('li.active').removeClass('active');
|
314
324
|
$(newOption).addClass('active');
|
315
325
|
collection.scrollTo(newOption);
|
316
|
-
}
|
326
|
+
};
|
317
327
|
|
318
328
|
// Allow user to search by typing
|
319
329
|
// this array is cleared after 1 second
|
320
|
-
filterQuery = []
|
330
|
+
filterQuery = [];
|
321
331
|
|
322
332
|
onKeyDown = function(event){
|
323
333
|
// TAB - switch to another input
|
324
334
|
if(event.which == 9){
|
325
335
|
$newSelect.trigger('close');
|
326
|
-
return
|
336
|
+
return;
|
327
337
|
}
|
328
338
|
|
329
339
|
// ARROW DOWN WHEN SELECT IS CLOSED - open select options
|
330
340
|
if(event.which == 40 && !options.is(":visible")){
|
331
341
|
$newSelect.trigger('open');
|
332
|
-
return
|
342
|
+
return;
|
333
343
|
}
|
334
344
|
|
335
345
|
// ENTER WHEN SELECT IS CLOSED - submit form
|
336
346
|
if(event.which == 13 && !options.is(":visible")){
|
337
|
-
return
|
347
|
+
return;
|
338
348
|
}
|
339
349
|
|
340
350
|
event.preventDefault();
|
341
351
|
|
342
352
|
// CASE WHEN USER TYPE LETTERS
|
343
353
|
letter = String.fromCharCode(event.which).toLowerCase();
|
344
|
-
|
345
|
-
if (letter){
|
354
|
+
var nonLetters = [9,13,27,38,40];
|
355
|
+
if (letter && (nonLetters.indexOf(event.which) === -1)){
|
346
356
|
filterQuery.push(letter);
|
347
357
|
|
348
358
|
string = filterQuery.join("");
|
@@ -387,11 +397,11 @@
|
|
387
397
|
}
|
388
398
|
|
389
399
|
// Automaticaly clean filter query so user can search again by starting letters
|
390
|
-
setTimeout(function(){filterQuery = []}, 1000)
|
391
|
-
}
|
400
|
+
setTimeout(function(){ filterQuery = []; }, 1000);
|
401
|
+
};
|
392
402
|
|
393
403
|
$newSelect.on('keydown', onKeyDown);
|
394
404
|
});
|
395
|
-
}
|
405
|
+
};
|
396
406
|
|
397
407
|
}( jQuery ));
|
@@ -24,8 +24,13 @@ Materialize.elementOrParentIsFixed = function(element) {
|
|
24
24
|
}
|
25
25
|
});
|
26
26
|
return isFixed;
|
27
|
-
}
|
27
|
+
};
|
28
28
|
|
29
29
|
// Velocity has conflicts when loaded with jQuery, this will check for it
|
30
30
|
var Vel;
|
31
|
-
if ($) {
|
31
|
+
if ($) {
|
32
|
+
Vel = $.Velocity;
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
Vel = Velocity;
|
36
|
+
}
|
@@ -81,11 +81,11 @@
|
|
81
81
|
}
|
82
82
|
|
83
83
|
// Toggle Flow Text
|
84
|
-
var toggleFlowTextButton = $('#flow-toggle')
|
84
|
+
var toggleFlowTextButton = $('#flow-toggle');
|
85
85
|
toggleFlowTextButton.click( function(){
|
86
86
|
$('#flow-text-demo').children('p').each(function(){
|
87
87
|
$(this).toggleClass('flow-text');
|
88
|
-
})
|
88
|
+
});
|
89
89
|
});
|
90
90
|
|
91
91
|
// Toggle Containers on page
|
@@ -113,7 +113,7 @@
|
|
113
113
|
}
|
114
114
|
}
|
115
115
|
if (is_touch_device()) {
|
116
|
-
$('#nav-mobile').css({ overflow: 'auto'})
|
116
|
+
$('#nav-mobile').css({ overflow: 'auto'});
|
117
117
|
}
|
118
118
|
|
119
119
|
// Set checkbox on forms.html to indeterminate
|
@@ -124,7 +124,6 @@
|
|
124
124
|
|
125
125
|
// Plugin initialization
|
126
126
|
$('.slider').slider({full_width: true});
|
127
|
-
$('.tab-demo').show().tabs();
|
128
127
|
$('.parallax').parallax();
|
129
128
|
$('.modal-trigger').leanModal();
|
130
129
|
$('.scrollspy').scrollSpy();
|
@@ -1,9 +1,16 @@
|
|
1
1
|
(function($) {
|
2
|
+
var _stack = 0,
|
3
|
+
_lastID = 0,
|
4
|
+
_generateID = function() {
|
5
|
+
_lastID++;
|
6
|
+
return 'materialize-lean-overlay-' + _lastID;
|
7
|
+
};
|
8
|
+
|
2
9
|
$.fn.extend({
|
3
10
|
openModal: function(options) {
|
4
|
-
|
11
|
+
|
5
12
|
var overlay = $('<div id="lean-overlay"></div>');
|
6
|
-
$(
|
13
|
+
$('body').css('overflow', 'hidden').append(overlay);
|
7
14
|
|
8
15
|
var defaults = {
|
9
16
|
opacity: 0.5,
|
@@ -12,40 +19,50 @@
|
|
12
19
|
ready: undefined,
|
13
20
|
complete: undefined,
|
14
21
|
dismissible: true
|
15
|
-
}
|
22
|
+
},
|
23
|
+
overlayID = _generateID(),
|
24
|
+
$modal = $(this),
|
25
|
+
$overlay = $('<div class="lean-overlay"></div>'),
|
26
|
+
lStack = (++_stack);
|
27
|
+
|
28
|
+
// Store a reference of the overlay
|
29
|
+
$overlay.attr('id', overlayID).css('z-index', 1000 + lStack * 2);
|
30
|
+
$modal.data('overlay-id', overlayID).css('z-index', 1000 + lStack * 2 + 1);
|
31
|
+
|
32
|
+
$("body").append($overlay);
|
16
33
|
|
17
34
|
// Override defaults
|
18
35
|
options = $.extend(defaults, options);
|
19
36
|
|
20
37
|
if (options.dismissible) {
|
21
|
-
$
|
22
|
-
$
|
38
|
+
$overlay.click(function() {
|
39
|
+
$modal.closeModal(options);
|
23
40
|
});
|
24
41
|
// Return on ESC
|
25
|
-
$(document).on('keyup.leanModal', function(e) {
|
42
|
+
$(document).on('keyup.leanModal' + overlayID, function(e) {
|
26
43
|
if (e.keyCode === 27) { // ESC key
|
27
|
-
$
|
44
|
+
$modal.closeModal(options);
|
28
45
|
}
|
29
46
|
});
|
30
47
|
}
|
31
48
|
|
32
|
-
$
|
33
|
-
$
|
49
|
+
$modal.find(".modal-close").click(function(e) {
|
50
|
+
$modal.closeModal(options);
|
34
51
|
});
|
35
52
|
|
36
|
-
$
|
53
|
+
$overlay.css({ display : "block", opacity : 0 });
|
37
54
|
|
38
|
-
$
|
55
|
+
$modal.css({
|
39
56
|
display : "block",
|
40
57
|
opacity: 0
|
41
58
|
});
|
42
59
|
|
43
|
-
$
|
44
|
-
|
60
|
+
$overlay.velocity({opacity: options.opacity}, {duration: options.in_duration, queue: false, ease: "easeOutCubic"});
|
61
|
+
$modal.data('associated-overlay', $overlay[0]);
|
45
62
|
|
46
63
|
// Define Bottom Sheet animation
|
47
|
-
if ($
|
48
|
-
$
|
64
|
+
if ($modal.hasClass('bottom-sheet')) {
|
65
|
+
$modal.velocity({bottom: "0", opacity: 1}, {
|
49
66
|
duration: options.in_duration,
|
50
67
|
queue: false,
|
51
68
|
ease: "easeOutCubic",
|
@@ -58,8 +75,8 @@
|
|
58
75
|
});
|
59
76
|
}
|
60
77
|
else {
|
61
|
-
$
|
62
|
-
$
|
78
|
+
$modal.css({ top: "4%" });
|
79
|
+
$modal.velocity({top: "10%", opacity: 1}, {
|
63
80
|
duration: options.in_duration,
|
64
81
|
queue: false,
|
65
82
|
ease: "easeOutCubic",
|
@@ -81,48 +98,56 @@
|
|
81
98
|
var defaults = {
|
82
99
|
out_duration: 250,
|
83
100
|
complete: undefined
|
84
|
-
}
|
85
|
-
|
101
|
+
},
|
102
|
+
options = $.extend(defaults, options),
|
103
|
+
$modal = $(this),
|
104
|
+
overlayID = $modal.data('overlay-id'),
|
105
|
+
$overlay = $('#' + overlayID);
|
86
106
|
|
87
|
-
|
88
|
-
$(
|
107
|
+
// Disable scrolling
|
108
|
+
$('body').css('overflow', '');
|
89
109
|
|
90
|
-
$(
|
110
|
+
$modal.find('.modal-close').off();
|
111
|
+
$(document).off('keyup.leanModal' + overlayID);
|
112
|
+
|
113
|
+
$overlay.velocity( { opacity: 0}, {duration: options.out_duration, queue: false, ease: "easeOutQuart"});
|
91
114
|
|
92
115
|
|
93
116
|
// Define Bottom Sheet animation
|
94
|
-
if ($
|
95
|
-
$
|
117
|
+
if ($modal.hasClass('bottom-sheet')) {
|
118
|
+
$modal.velocity({bottom: "-100%", opacity: 0}, {
|
96
119
|
duration: options.out_duration,
|
97
120
|
queue: false,
|
98
121
|
ease: "easeOutCubic",
|
99
122
|
// Handle modal ready callback
|
100
123
|
complete: function() {
|
101
|
-
$
|
124
|
+
$overlay.css({display:"none"});
|
102
125
|
|
103
126
|
// Call complete callback
|
104
127
|
if (typeof(options.complete) === "function") {
|
105
128
|
options.complete();
|
106
129
|
}
|
107
|
-
$
|
130
|
+
$overlay.remove();
|
131
|
+
_stack--;
|
108
132
|
}
|
109
133
|
});
|
110
134
|
}
|
111
135
|
else {
|
112
|
-
$
|
113
|
-
$
|
114
|
-
$
|
136
|
+
$modal.fadeOut(options.out_duration, function() {
|
137
|
+
$modal.css({ top: 0});
|
138
|
+
$overlay.css({display:"none"});
|
115
139
|
|
116
140
|
// Call complete callback
|
117
141
|
if (typeof(options.complete) === "function") {
|
118
142
|
options.complete();
|
119
143
|
}
|
120
|
-
$
|
144
|
+
$overlay.remove();
|
145
|
+
_stack--;
|
121
146
|
});
|
122
147
|
}
|
123
148
|
|
124
149
|
}
|
125
|
-
})
|
150
|
+
});
|
126
151
|
|
127
152
|
$.fn.extend({
|
128
153
|
leanModal: function(options) {
|