materialize-sass 0.95.1 → 0.95.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +18 -9
- data/app/assets/javascripts/{materialize-sprokets.js → materialize-sprockets.js} +5 -1
- data/app/assets/javascripts/materialize.js +453 -139
- data/app/assets/javascripts/materialize/animations.js +8 -0
- data/app/assets/javascripts/materialize/buttons.js +35 -0
- data/app/assets/javascripts/materialize/cards.js +7 -3
- data/app/assets/javascripts/materialize/collapsible.js +6 -6
- data/app/assets/javascripts/materialize/dropdown.js +42 -32
- data/app/assets/javascripts/materialize/forms.js +128 -18
- data/app/assets/javascripts/materialize/hammer.min.js +1 -1
- data/app/assets/javascripts/materialize/init.js +13 -36
- data/app/assets/javascripts/materialize/jquery.easing.1.3.js +34 -34
- data/app/assets/javascripts/materialize/parallax.js +19 -17
- data/app/assets/javascripts/materialize/scrollFire.js +29 -0
- data/app/assets/javascripts/materialize/scrollspy.js +1 -1
- data/app/assets/javascripts/materialize/sideNav.js +32 -16
- data/app/assets/javascripts/materialize/slider.js +16 -9
- data/app/assets/javascripts/materialize/transitions.js +94 -0
- data/app/assets/stylesheets/materialize.scss +30 -30
- data/app/assets/stylesheets/{components → materialize/components}/_buttons.scss +29 -0
- data/app/assets/stylesheets/{components → materialize/components}/_cards.scss +36 -7
- data/app/assets/stylesheets/{components → materialize/components}/_collapsible.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_color.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_dropdown.scss +2 -2
- data/app/assets/stylesheets/{components → materialize/components}/_form.scss +88 -31
- data/app/assets/stylesheets/{components → materialize/components}/_global.scss +63 -13
- data/app/assets/stylesheets/{components → materialize/components}/_grid.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_icons-material-design.scss +5 -5
- data/app/assets/stylesheets/{components → materialize/components}/_materialbox.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_mixins.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_modal.scss +34 -8
- data/app/assets/stylesheets/{components → materialize/components}/_navbar.scss +9 -4
- data/app/assets/stylesheets/{components → materialize/components}/_normalize.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_prefixer.scss +3 -4
- data/app/assets/stylesheets/{components → materialize/components}/_preloader.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_roboto.scss +5 -5
- data/app/assets/stylesheets/{components → materialize/components}/_sideNav.scss +28 -67
- data/app/assets/stylesheets/{components → materialize/components}/_slider.scss +5 -1
- data/app/assets/stylesheets/{components → materialize/components}/_table_of_contents.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_tabs.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_toast.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_tooltip.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_typography.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/_variables.scss +6 -2
- data/app/assets/stylesheets/{components → materialize/components}/_waves.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/date_picker/_default.date.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/date_picker/_default.scss +0 -0
- data/app/assets/stylesheets/{components → materialize/components}/date_picker/_default.time.scss +0 -0
- data/lib/materialize-sass.rb +7 -0
- data/lib/materialize-sass/version.rb +1 -1
- data/materialize-sass.gemspec +4 -0
- metadata +68 -42
- checksums.yaml +0 -7
@@ -0,0 +1,35 @@
|
|
1
|
+
(function ($) {
|
2
|
+
$(document).ready(function() {
|
3
|
+
|
4
|
+
// jQuery reverse
|
5
|
+
jQuery.fn.reverse = [].reverse;
|
6
|
+
|
7
|
+
$('.fixed-action-btn').each(function (i) {
|
8
|
+
var $this = $(this);
|
9
|
+
$this.find('ul a.btn-floating').velocity(
|
10
|
+
{ scaleY: ".4", scaleX: ".4", translateY: "40px"},
|
11
|
+
{ duration: 0 });
|
12
|
+
|
13
|
+
|
14
|
+
var timer;
|
15
|
+
$this.hover(
|
16
|
+
function() {
|
17
|
+
var time = 0;
|
18
|
+
$this.find('ul a.btn-floating').reverse().each(function () {
|
19
|
+
$(this).velocity(
|
20
|
+
{ opacity: "1", scaleX: "1", scaleY: "1", translateY: "0"},
|
21
|
+
{ duration: 100, delay: time });
|
22
|
+
time += 40;
|
23
|
+
});
|
24
|
+
}, function() {
|
25
|
+
var time = 0;
|
26
|
+
$this.find('ul a.btn-floating').velocity("stop", true);
|
27
|
+
$this.find('ul a.btn-floating').velocity(
|
28
|
+
{ opacity: "0", scaleX: ".4", scaleY: ".4", translateY: "40px"},
|
29
|
+
{ duration: 100 });
|
30
|
+
}
|
31
|
+
);
|
32
|
+
});
|
33
|
+
|
34
|
+
});
|
35
|
+
}( jQuery ));
|
@@ -1,14 +1,18 @@
|
|
1
1
|
(function ($) {
|
2
2
|
$(document).ready(function() {
|
3
3
|
|
4
|
+
$('.card > .card-reveal').each(function() {
|
5
|
+
$(this).parent().css('overflow', 'hidden');
|
6
|
+
});
|
7
|
+
|
4
8
|
$(document).on('click.card', '.card', function (e) {
|
5
9
|
if ($(this).find('.card-reveal').length) {
|
6
10
|
if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
|
7
|
-
$(this).find('.card-reveal').velocity({translateY: 0}, {duration:
|
11
|
+
$(this).find('.card-reveal').velocity({translateY: 0}, {duration: 225, queue: false, easing: 'easeInOutQuad'});
|
8
12
|
}
|
9
13
|
else if ($(e.target).is($('.card .activator')) ||
|
10
14
|
$(e.target).is($('.card .activator i')) ) {
|
11
|
-
$(this).find('.card-reveal').velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: '
|
15
|
+
$(this).find('.card-reveal').velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});
|
12
16
|
}
|
13
17
|
}
|
14
18
|
|
@@ -16,4 +20,4 @@
|
|
16
20
|
});
|
17
21
|
|
18
22
|
});
|
19
|
-
}( jQuery ));
|
23
|
+
}( jQuery ));
|
@@ -16,8 +16,8 @@
|
|
16
16
|
var collapsible_type = $this.data("collapsible");
|
17
17
|
|
18
18
|
// Turn off any existing event handlers
|
19
|
-
$this.off();
|
20
|
-
$
|
19
|
+
$this.off('click.collapse', '.collapsible-header');
|
20
|
+
$panel_headers.off('click.collapse');
|
21
21
|
|
22
22
|
|
23
23
|
/****************
|
@@ -54,8 +54,8 @@
|
|
54
54
|
|
55
55
|
if (options.accordion || collapsible_type == "accordion" || collapsible_type == undefined) { // Handle Accordion
|
56
56
|
|
57
|
-
// Event delegation to
|
58
|
-
$this.on('click', '.collapsible-header', function (e) {
|
57
|
+
// Event delegation to all collapsible section
|
58
|
+
$this.on('click.collapse', '.collapsible-header', function (e) {
|
59
59
|
accordionOpen($(e.currentTarget));
|
60
60
|
});
|
61
61
|
|
@@ -66,7 +66,7 @@
|
|
66
66
|
$panel_headers.each(function () {
|
67
67
|
|
68
68
|
// Event delegation to open collapsible section
|
69
|
-
$this.on('click
|
69
|
+
$(this).on('click.collapse', function (e) {
|
70
70
|
collapsibleOpen($(e.currentTarget));
|
71
71
|
});
|
72
72
|
|
@@ -84,4 +84,4 @@
|
|
84
84
|
$(document).ready(function(){
|
85
85
|
$('.collapsible').collapsible();
|
86
86
|
});
|
87
|
-
}( jQuery ));
|
87
|
+
}( jQuery ));
|
@@ -1,5 +1,12 @@
|
|
1
1
|
(function ($) {
|
2
2
|
|
3
|
+
// Add posibility to scroll to selected option
|
4
|
+
// usefull for select for example
|
5
|
+
$.fn.scrollTo = function(elem) {
|
6
|
+
$(this).scrollTop($(this).scrollTop() - $(this).offset().top + $(elem).offset().top);
|
7
|
+
return this;
|
8
|
+
};
|
9
|
+
|
3
10
|
$.fn.dropdown = function (options) {
|
4
11
|
var defaults = {
|
5
12
|
inDuration: 300,
|
@@ -7,7 +14,8 @@
|
|
7
14
|
constrain_width: true, // Constrains width of dropdown to the activator
|
8
15
|
hover: true,
|
9
16
|
alignment: 'left',
|
10
|
-
gutter: 0 // Spacing from edge
|
17
|
+
gutter: 0, // Spacing from edge
|
18
|
+
belowOrigin: false
|
11
19
|
}
|
12
20
|
|
13
21
|
options = $.extend(defaults, options);
|
@@ -30,6 +38,8 @@
|
|
30
38
|
options.alignment = origin.data('alignment');
|
31
39
|
if (origin.data('gutter') != undefined)
|
32
40
|
options.gutter = origin.data('gutter');
|
41
|
+
if (origin.data('beloworigin') != undefined)
|
42
|
+
options.belowOrigin = origin.data('beloworigin');
|
33
43
|
}
|
34
44
|
|
35
45
|
updateOptions();
|
@@ -40,6 +50,8 @@
|
|
40
50
|
$('body').append(activates);
|
41
51
|
}
|
42
52
|
|
53
|
+
var dropdownRealHeight = activates.height();
|
54
|
+
|
43
55
|
/*
|
44
56
|
Helper function to position and resize dropdown.
|
45
57
|
Used in hover and click handler.
|
@@ -48,10 +60,13 @@
|
|
48
60
|
// Check html data attributes
|
49
61
|
updateOptions();
|
50
62
|
|
51
|
-
var dropdownRealHeight = activates.height();
|
52
63
|
if (options.constrain_width == true) {
|
53
64
|
activates.css('width', origin.outerWidth());
|
54
65
|
}
|
66
|
+
var offset = 0;
|
67
|
+
if (options.belowOrigin == true) {
|
68
|
+
offset = origin.height();
|
69
|
+
}
|
55
70
|
// Handle edge alignment
|
56
71
|
var width_difference = 0;
|
57
72
|
var gutter_spacing = options.gutter;
|
@@ -64,14 +79,14 @@
|
|
64
79
|
display: 'block',
|
65
80
|
position: 'fixed',
|
66
81
|
height: 0,
|
67
|
-
top: origin.offset().top - $(window).scrollTop(),
|
82
|
+
top: origin.offset().top - $(window).scrollTop() + offset,
|
68
83
|
left: origin.offset().left + width_difference + gutter_spacing
|
69
84
|
});
|
70
85
|
}
|
71
86
|
else {
|
72
87
|
activates.css({
|
73
88
|
display: 'block',
|
74
|
-
top: origin.offset().top,
|
89
|
+
top: origin.offset().top + offset,
|
75
90
|
left: origin.offset().left + width_difference + gutter_spacing,
|
76
91
|
height: 0
|
77
92
|
});
|
@@ -102,6 +117,22 @@
|
|
102
117
|
return isFixed;
|
103
118
|
}
|
104
119
|
|
120
|
+
function hideDropdown() {
|
121
|
+
activates.velocity(
|
122
|
+
{
|
123
|
+
opacity: 0
|
124
|
+
},
|
125
|
+
{
|
126
|
+
duration: options.outDuration,
|
127
|
+
easing: 'easeOutQuad',
|
128
|
+
complete: function(){
|
129
|
+
activates.css({
|
130
|
+
display: 'none',
|
131
|
+
'overflow-y': ''
|
132
|
+
});
|
133
|
+
}
|
134
|
+
});
|
135
|
+
}
|
105
136
|
|
106
137
|
// Hover
|
107
138
|
if (options.hover) {
|
@@ -112,20 +143,7 @@
|
|
112
143
|
|
113
144
|
// Document click handler
|
114
145
|
activates.on('mouseleave', function(e){ // Mouse out
|
115
|
-
|
116
|
-
{
|
117
|
-
opacity: 0
|
118
|
-
},
|
119
|
-
{
|
120
|
-
duration: options.outDuration,
|
121
|
-
easing: 'easeOutQuad',
|
122
|
-
complete: function(){
|
123
|
-
activates.css({
|
124
|
-
display: 'none',
|
125
|
-
'overflow-y': ''
|
126
|
-
});
|
127
|
-
}
|
128
|
-
});
|
146
|
+
hideDropdown();
|
129
147
|
});
|
130
148
|
|
131
149
|
// Click
|
@@ -139,19 +157,7 @@
|
|
139
157
|
placeDropdown();
|
140
158
|
$(document).bind('click.'+ activates.attr('id'), function (e) {
|
141
159
|
if (!activates.is(e.target) && (!origin.is(e.target))) {
|
142
|
-
|
143
|
-
opacity: 0
|
144
|
-
},
|
145
|
-
{
|
146
|
-
duration: options.outDuration,
|
147
|
-
easing: 'easeOutQuad',
|
148
|
-
complete: function(){
|
149
|
-
activates.css({
|
150
|
-
display: 'none',
|
151
|
-
'overflow-y': ''
|
152
|
-
});
|
153
|
-
}
|
154
|
-
});
|
160
|
+
hideDropdown();
|
155
161
|
$(document).unbind('click.' + activates.attr('id'));
|
156
162
|
}
|
157
163
|
});
|
@@ -159,10 +165,14 @@
|
|
159
165
|
|
160
166
|
} // End else
|
161
167
|
|
168
|
+
// Listen to open and close event - usefull for select component
|
169
|
+
origin.on('open', placeDropdown);
|
170
|
+
origin.on('close', hideDropdown);
|
171
|
+
|
162
172
|
// Window Resize Reposition
|
163
173
|
$(document).on('resize', function(){
|
164
174
|
|
165
175
|
});
|
166
176
|
});
|
167
177
|
}; // End dropdown plugin
|
168
|
-
}( jQuery ));
|
178
|
+
}( jQuery ));
|
@@ -7,8 +7,9 @@
|
|
7
7
|
// Add active if form auto complete
|
8
8
|
$(document).on('change', input_selector, function () {
|
9
9
|
if($(this).val().length !== 0) {
|
10
|
-
|
10
|
+
$(this).siblings('label, i').addClass('active');
|
11
11
|
}
|
12
|
+
validate_field($(this));
|
12
13
|
});
|
13
14
|
|
14
15
|
// Add active if input element has been pre-populated on document ready
|
@@ -28,7 +29,7 @@
|
|
28
29
|
// Reset select
|
29
30
|
$(this).find('select.initialized').each(function () {
|
30
31
|
var reset_text = $(this).find('option[selected]').text();
|
31
|
-
$(this).
|
32
|
+
$(this).siblings('input.select-dropdown').val(reset_text);
|
32
33
|
});
|
33
34
|
}
|
34
35
|
});
|
@@ -41,25 +42,30 @@
|
|
41
42
|
$(document).on('blur', input_selector, function () {
|
42
43
|
if ($(this).val().length === 0) {
|
43
44
|
$(this).siblings('label, i').removeClass('active');
|
45
|
+
}
|
46
|
+
validate_field($(this));
|
47
|
+
});
|
44
48
|
|
45
|
-
|
46
|
-
|
47
|
-
|
49
|
+
validate_field = function(object) {
|
50
|
+
if (object.val().length === 0) {
|
51
|
+
if (object.hasClass('validate')) {
|
52
|
+
object.removeClass('valid');
|
53
|
+
object.removeClass('invalid');
|
48
54
|
}
|
49
55
|
}
|
50
56
|
else {
|
51
|
-
if (
|
52
|
-
if (
|
53
|
-
|
54
|
-
|
57
|
+
if (object.hasClass('validate')) {
|
58
|
+
if (object.is(':valid')) {
|
59
|
+
object.removeClass('invalid');
|
60
|
+
object.addClass('valid');
|
55
61
|
}
|
56
62
|
else {
|
57
|
-
|
58
|
-
|
63
|
+
object.removeClass('valid');
|
64
|
+
object.addClass('invalid');
|
59
65
|
}
|
60
66
|
}
|
61
67
|
}
|
62
|
-
}
|
68
|
+
}
|
63
69
|
|
64
70
|
|
65
71
|
// Textarea Auto Resize
|
@@ -89,6 +95,16 @@
|
|
89
95
|
});
|
90
96
|
|
91
97
|
|
98
|
+
// File Input Path
|
99
|
+
$('.file-field').each(function() {
|
100
|
+
var path_input = $(this).find('input.file-path');
|
101
|
+
$(this).find('input[type="file"]').change(function () {
|
102
|
+
path_input.val($(this).val());
|
103
|
+
path_input.trigger('change');
|
104
|
+
});
|
105
|
+
});
|
106
|
+
|
107
|
+
|
92
108
|
// Range Input
|
93
109
|
var range_type = 'input[type=range]';
|
94
110
|
var range_mousedown = false;
|
@@ -164,15 +180,13 @@
|
|
164
180
|
}
|
165
181
|
});
|
166
182
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
183
|
// Select Functionality
|
171
184
|
|
172
185
|
// Select Plugin
|
173
186
|
$.fn.material_select = function (callback) {
|
174
187
|
$(this).each(function(){
|
175
188
|
$select = $(this);
|
189
|
+
|
176
190
|
if ( $select.hasClass('browser-default') || $select.hasClass('initialized')) {
|
177
191
|
return; // Continue to next (return false breaks out of entire loop)
|
178
192
|
}
|
@@ -204,7 +218,7 @@
|
|
204
218
|
$curr_select.find('option').eq(i).prop('selected', true);
|
205
219
|
// Trigger onchange() event
|
206
220
|
$curr_select.trigger('change');
|
207
|
-
$curr_select.
|
221
|
+
$curr_select.siblings('input.select-dropdown').val($(this).text());
|
208
222
|
if (typeof callback !== 'undefined') callback();
|
209
223
|
}
|
210
224
|
});
|
@@ -214,8 +228,8 @@
|
|
214
228
|
// Wrap Elements
|
215
229
|
$select.wrap(wrapper);
|
216
230
|
// Add Select Display Element
|
217
|
-
var $newSelect = $('<
|
218
|
-
+ '
|
231
|
+
var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + (($select.is(':disabled')) ? 'disabled' : '')
|
232
|
+
+ ' data-activates="select-options-' + uniqueID +'" value="'+ label.html() +'"/><i class="mdi-navigation-arrow-drop-down">');
|
219
233
|
$select.before($newSelect);
|
220
234
|
$('body').append(options);
|
221
235
|
// Check if section element is disabled
|
@@ -224,6 +238,102 @@
|
|
224
238
|
}
|
225
239
|
$select.addClass('initialized');
|
226
240
|
|
241
|
+
$newSelect.on('focus', function(){
|
242
|
+
$(this).trigger('open');
|
243
|
+
label = $(this).val();
|
244
|
+
selectedOption = options.find('li').filter(function() {
|
245
|
+
return $(this).text().toLowerCase() === label.toLowerCase();
|
246
|
+
})[0];
|
247
|
+
activateOption(options, selectedOption);
|
248
|
+
});
|
249
|
+
|
250
|
+
$newSelect.on('blur', function(){
|
251
|
+
$(this).trigger('close');
|
252
|
+
});
|
253
|
+
|
254
|
+
// Make option as selected and scroll to selected position
|
255
|
+
activateOption = function(collection, newOption) {
|
256
|
+
collection.find('li.active').removeClass('active');
|
257
|
+
$(newOption).addClass('active');
|
258
|
+
collection.scrollTo(newOption);
|
259
|
+
}
|
260
|
+
|
261
|
+
// Allow user to search by typing
|
262
|
+
// this array is cleared after 1 second
|
263
|
+
filterQuery = []
|
264
|
+
|
265
|
+
onKeyDown = function(event){
|
266
|
+
// TAB - switch to another input
|
267
|
+
if(event.which == 9){
|
268
|
+
$newSelect.trigger('close');
|
269
|
+
return
|
270
|
+
}
|
271
|
+
|
272
|
+
// ARROW DOWN WHEN SELECT IS CLOSED - open select options
|
273
|
+
if(event.which == 40 && !options.is(":visible")){
|
274
|
+
$newSelect.trigger('open');
|
275
|
+
return
|
276
|
+
}
|
277
|
+
|
278
|
+
// ENTER WHEN SELECT IS CLOSED - submit form
|
279
|
+
if(event.which == 13 && !options.is(":visible")){
|
280
|
+
return
|
281
|
+
}
|
282
|
+
|
283
|
+
event.preventDefault();
|
284
|
+
|
285
|
+
// CASE WHEN USER TYPE LETTERS
|
286
|
+
letter = String.fromCharCode(event.which).toLowerCase();
|
287
|
+
|
288
|
+
if (letter){
|
289
|
+
filterQuery.push(letter);
|
290
|
+
|
291
|
+
string = filterQuery.join("");
|
292
|
+
|
293
|
+
newOption = options.find('li').filter(function() {
|
294
|
+
return $(this).text().toLowerCase().indexOf(string) === 0;
|
295
|
+
})[0];
|
296
|
+
|
297
|
+
if(newOption){
|
298
|
+
activateOption(options, newOption);
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
// ENTER - select option and close when select options are opened
|
303
|
+
if(event.which == 13){
|
304
|
+
activeOption = options.find('li.active:not(.disabled)')[0];
|
305
|
+
if(activeOption){
|
306
|
+
$(activeOption).trigger('click');
|
307
|
+
$newSelect.trigger('close');
|
308
|
+
}
|
309
|
+
}
|
310
|
+
|
311
|
+
// ARROW DOWN - move to next not disabled option
|
312
|
+
if(event.which == 40){
|
313
|
+
newOption = options.find('li.active').next('li:not(.disabled)')[0];
|
314
|
+
if(newOption){
|
315
|
+
activateOption(options, newOption);
|
316
|
+
}
|
317
|
+
}
|
318
|
+
|
319
|
+
// ESC - close options
|
320
|
+
if(event.which == 27){
|
321
|
+
$newSelect.trigger('close');
|
322
|
+
}
|
323
|
+
|
324
|
+
// ARROW UP - move to previous not disabled option
|
325
|
+
if(event.which == 38){
|
326
|
+
newOption = options.find('li.active').prev('li:not(.disabled)')[0];
|
327
|
+
if(newOption){
|
328
|
+
activateOption(options, newOption);
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
332
|
+
// Automaticaly clean filter query so user can search again by starting letters
|
333
|
+
setTimeout(function(){filterQuery = []}, 1000)
|
334
|
+
}
|
335
|
+
|
336
|
+
$newSelect.on('keydown', onKeyDown);
|
227
337
|
});
|
228
338
|
}
|
229
339
|
|