materialize-sass 0.97.2 → 0.97.3

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.
@@ -1,4 +1,4 @@
1
- (function ($) {
1
+ (function ($) {
2
2
  $.fn.collapsible = function(options) {
3
3
  var defaults = {
4
4
  accordion: undefined
@@ -95,38 +95,36 @@
95
95
 
96
96
 
97
97
 
98
- if (options.accordion || collapsible_type === "accordion" || collapsible_type === undefined) { // Handle Accordion
99
- // Add click handler to only direct collapsible header children
100
- $panel_headers = $this.find('> li > .collapsible-header');
101
- $panel_headers.on('click.collapse', function (e) {
102
- var element = $(e.target);
98
+ // Add click handler to only direct collapsible header children
99
+ $this.on('click.collapse', '> li > .collapsible-header', function(e) {
100
+ var $header = $(this),
101
+ element = $(e.target);
103
102
 
104
- if (isChildrenOfPanelHeader(element)) {
105
- element = getPanelHeader(element);
106
- }
103
+ if (isChildrenOfPanelHeader(element)) {
104
+ element = getPanelHeader(element);
105
+ }
107
106
 
108
- element.toggleClass('active');
107
+ element.toggleClass('active');
108
+
109
+ if (options.accordion || collapsible_type === "accordion" || collapsible_type === undefined) { // Handle Accordion
109
110
  accordionOpen(element);
110
- });
111
- // Open first active
111
+ } else { // Handle Expandables
112
+ expandableOpen(element);
113
+
114
+ if ($header.hasClass('active')) {
115
+ expandableOpen($header);
116
+ }
117
+ }
118
+ });
119
+
120
+ // Open first active
121
+ var $panel_headers = $this.find('> li > .collapsible-header');
122
+ if (options.accordion || collapsible_type === "accordion" || collapsible_type === undefined) { // Handle Accordion
112
123
  accordionOpen($panel_headers.filter('.active').first());
113
124
  }
114
125
  else { // Handle Expandables
115
- $panel_headers.each(function () {
116
- // Add click handler to only direct collapsible header children
117
- $(this).on('click.collapse', function (e) {
118
- var element = $(e.target);
119
- if (isChildrenOfPanelHeader(element)) {
120
- element = getPanelHeader(element);
121
- }
122
- element.toggleClass('active');
123
- expandableOpen(element);
124
- });
125
- // Open any bodies that have the active class
126
- if ($(this).hasClass('active')) {
127
- expandableOpen($(this));
128
- }
129
-
126
+ $panel_headers.filter('.active').each(function() {
127
+ expandableOpen($(this));
130
128
  });
131
129
  }
132
130
 
@@ -73,17 +73,20 @@
73
73
  activates.css('white-space', 'nowrap');
74
74
  }
75
75
 
76
- // Below Origin
77
- var verticalOffset = 0;
78
- if (options.belowOrigin === true) {
79
- verticalOffset = origin.height();
80
- }
81
-
82
76
  // Offscreen detection
77
+ var windowHeight = window.innerHeight;
78
+ var originHeight = origin.innerHeight();
83
79
  var offsetLeft = origin.offset().left;
84
80
  var offsetTop = origin.offset().top - $(window).scrollTop();
85
81
  var currAlignment = options.alignment;
86
82
  var activatesLeft, gutterSpacing;
83
+
84
+ // Below Origin
85
+ var verticalOffset = 0;
86
+ if (options.belowOrigin === true) {
87
+ verticalOffset = originHeight;
88
+ }
89
+
87
90
  if (offsetLeft + activates.innerWidth() > $(window).width()) {
88
91
  // Dropdown goes past screen on right, force right alignment
89
92
  currAlignment = 'right';
@@ -93,11 +96,18 @@
93
96
  currAlignment = 'left';
94
97
  }
95
98
  // Vertical bottom offscreen detection
96
- if (offsetTop + activates.innerHeight() > window.innerHeight) {
97
- if (!verticalOffset) {
98
- verticalOffset += origin.innerHeight();
99
+ if (offsetTop + activates.innerHeight() > windowHeight) {
100
+ // If going upwards still goes offscreen, just crop height of dropdown.
101
+ if (offsetTop + originHeight - activates.innerHeight() < 0) {
102
+ var adjustedHeight = windowHeight - offsetTop - verticalOffset;
103
+ activates.css('max-height', adjustedHeight);
104
+ } else {
105
+ // Flow upwards.
106
+ if (!verticalOffset) {
107
+ verticalOffset += originHeight;
108
+ }
109
+ verticalOffset -= activates.innerHeight();
99
110
  }
100
- verticalOffset -= activates.innerHeight();
101
111
  }
102
112
 
103
113
  // Handle edge alignment
@@ -137,6 +147,7 @@
137
147
  isFocused = false;
138
148
  activates.fadeOut(options.outDuration);
139
149
  activates.removeClass('active');
150
+ activates.css('max-height', '');
140
151
  origin.removeClass('active');
141
152
  }
142
153
 
@@ -1,3 +1,13 @@
1
+ /*!
2
+ * Materialize v0.97.3 (http://materializecss.com)
3
+ * Copyright 2014-2015 Materialize
4
+ * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
+ */
6
+ /*!
7
+ * Materialize v0.97.2 (http://materializecss.com)
8
+ * Copyright 2014-2015 Materialize
9
+ * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
10
+ */
1
11
  /*!
2
12
  * Materialize v0.97.1 (http://materializecss.com)
3
13
  * Copyright 2014-2015 Materialize
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Materialize v0.97.1 (http://materializecss.com)
2
+ * Materialize v0.97.3 (http://materializecss.com)
3
3
  * Copyright 2014-2015 Materialize
4
4
  * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
5
  */
@@ -307,6 +307,36 @@
307
307
  label = selectOptions.first();
308
308
  }
309
309
 
310
+ // Function that renders and appends the option taking into
311
+ // account type and possible image icon.
312
+ var appendOptionWithIcon = function(select, option, type) {
313
+ // Add disabled attr if disabled
314
+ var disabledClass = (option.is(':disabled')) ? 'disabled ' : '';
315
+
316
+ // add icons
317
+ var icon_url = option.data('icon');
318
+ var classes = option.attr('class');
319
+ if (!!icon_url) {
320
+ var classString = '';
321
+ if (!!classes) classString = ' class="' + classes + '"';
322
+
323
+ // Check for multiple type.
324
+ if (type === 'multiple') {
325
+ options.append($('<li class="' + disabledClass + '"><img src="' + icon_url + '"' + classString + '><span><input type="checkbox"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));
326
+ } else {
327
+ options.append($('<li class="' + disabledClass + '"><img src="' + icon_url + '"' + classString + '><span>' + option.html() + '</span></li>'));
328
+ }
329
+ return true;
330
+ }
331
+
332
+ // Check for multiple type.
333
+ if (type === 'multiple') {
334
+ options.append($('<li class="' + disabledClass + '"><span><input type="checkbox"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));
335
+ } else {
336
+ options.append($('<li class="' + disabledClass + '"><span>' + option.html() + '</span></li>'));
337
+ }
338
+ };
339
+
310
340
  /* Create dropdown structure. */
311
341
  if (selectOptGroups.length) {
312
342
  // Check for optgroup
@@ -315,37 +345,17 @@
315
345
  options.append($('<li class="optgroup"><span>' + $(this).attr('label') + '</span></li>'));
316
346
 
317
347
  selectOptions.each(function() {
318
- var disabledClass = ($(this).is(':disabled')) ? 'disabled ' : '';
319
-
320
- // Add icons
321
- if ($select.hasClass('icons')) {
322
- var icon_url = $(this).data('icon');
323
- var classes = $(this).attr('class');
324
- if (!!icon_url) {
325
- options.append($('<li class="' + disabledClass + '"><img src="' + icon_url + '" class="' + classes + '"><span>' + $(this).html() + '</span></li>'));
326
- return true;
327
- }
328
- }
329
- options.append($('<li class="' + disabledClass + '"><span>' + $(this).html() + '</span></li>'));
348
+ appendOptionWithIcon($select, $(this));
330
349
  });
331
350
  });
332
351
  } else {
333
352
  selectOptions.each(function () {
334
- // Add disabled attr if disabled
335
353
  var disabledClass = ($(this).is(':disabled')) ? 'disabled ' : '';
336
354
  if (multiple) {
337
- options.append($('<li class="' + disabledClass + '"><span><input type="checkbox"' + disabledClass + '/><label></label>' + $(this).html() + '</span></li>'));
355
+ appendOptionWithIcon($select, $(this), 'multiple');
356
+
338
357
  } else {
339
- // Add icons
340
- if ($select.hasClass('icons')) {
341
- var icon_url = $(this).data('icon');
342
- var classes = $(this).attr('class');
343
- if (!!icon_url) {
344
- options.append($('<li class="' + disabledClass + '"><img src="' + icon_url + '" class="' + classes + '"><span>' + $(this).html() + '</span></li>'));
345
- return true;
346
- }
347
- }
348
- options.append($('<li class="' + disabledClass + '"><span>' + $(this).html() + '</span></li>'));
358
+ appendOptionWithIcon($select, $(this));
349
359
  }
350
360
  });
351
361
  }
@@ -392,7 +402,7 @@
392
402
  $select.before($newSelect);
393
403
  $newSelect.before(dropdownIcon);
394
404
 
395
- $('body').append(options);
405
+ $newSelect.after(options);
396
406
  // Check if section element is disabled
397
407
  if (!$select.is(':disabled')) {
398
408
  $newSelect.dropdown({'hover': false, 'closeOnClick': false});
@@ -123,6 +123,8 @@
123
123
 
124
124
 
125
125
  // Plugin initialization
126
+ $('.carousel.carousel-slider').carousel({full_width: true});
127
+ $('.carousel').carousel();
126
128
  $('.slider').slider({full_width: true});
127
129
  $('.parallax').parallax();
128
130
  $('.modal-trigger').leanModal();
@@ -13,7 +13,6 @@
13
13
  var $active, $content, $links = $this.find('li.tab a'),
14
14
  $tabs_width = $this.width(),
15
15
  $tab_width = $this.find('li').first().outerWidth(),
16
- $tab_min_width = parseInt($this.find('li').first().css('minWidth')),
17
16
  $index = 0;
18
17
 
19
18
  // If the location.hash matches one of the links, use that as the active tab.
@@ -105,24 +104,6 @@
105
104
  // Prevent the anchor's default click action
106
105
  e.preventDefault();
107
106
  });
108
-
109
- // Add scroll for small screens
110
- if ($tab_width <= $tab_min_width) {
111
- $this.wrap('<div class="hide-tab-scrollbar"></div>');
112
-
113
- // Create the measurement node
114
- var scrollDiv = document.createElement("div");
115
- scrollDiv.className = "scrollbar-measure";
116
- document.body.appendChild(scrollDiv);
117
- var scrollbarHeight = scrollDiv.offsetHeight - scrollDiv.clientHeight;
118
- document.body.removeChild(scrollDiv);
119
-
120
- if (scrollbarHeight === 0) {
121
- scrollbarHeight = 15;
122
- $this.find('.indicator').css('bottom', scrollbarHeight);
123
- }
124
- $this.height($(this).height() + scrollbarHeight);
125
- }
126
107
  });
127
108
 
128
109
  },
@@ -34,6 +34,7 @@
34
34
  @import "materialize/components/sideNav";
35
35
  @import "materialize/components/preloader";
36
36
  @import "materialize/components/slider";
37
+ @import "materialize/components/carousel";
37
38
  @import "materialize/components/date_picker/default.scss";
38
39
  @import "materialize/components/date_picker/default.date.scss";
39
40
  @import "materialize/components/date_picker/default.time.scss";
@@ -0,0 +1,38 @@
1
+ .carousel {
2
+ overflow: hidden;
3
+ position: relative;
4
+ width: 100%;
5
+ height: 400px;
6
+
7
+
8
+ @include perspective(500px);
9
+ transform-style: preserve-3d;
10
+ -webkit-transform-style: preserve-3d;
11
+ transform-origin: 0% 50%;
12
+
13
+ .carousel-item {
14
+ width: 200px;
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+
19
+ img {
20
+ width: 100%;
21
+ }
22
+ }
23
+
24
+ &.carousel-slider {
25
+ top: 0;
26
+ left: 0;
27
+ height: 0;
28
+
29
+ .carousel-item {
30
+ width: 100%;
31
+ height: 100%;
32
+ position: absolute;
33
+ top: 0;
34
+ left: 0;
35
+ }
36
+ }
37
+ }
38
+
@@ -695,11 +695,11 @@ select:disabled {
695
695
  border-top: 1px solid $dropdown-hover-bg-color;
696
696
 
697
697
  &.selected > span {
698
- color: rgba(0,0,0, .7);
698
+ color: rgba(0, 0, 0, .7);
699
699
  }
700
700
 
701
701
  & > span {
702
- color: rgba(0,0,0, .4);
702
+ color: rgba(0, 0, 0, .4);
703
703
  }
704
704
 
705
705
  & ~ li:not(.optgroup) {
@@ -61,7 +61,6 @@
61
61
  $perc: unquote((100 / ($num-cols / $i)) + "%");
62
62
  &.s#{$i} {
63
63
  width: $perc;
64
- margin-left: 0;
65
64
  }
66
65
  &.offset-s#{$i} {
67
66
  margin-left: $perc;
@@ -82,7 +81,6 @@
82
81
  $perc: unquote((100 / ($num-cols / $i)) + "%");
83
82
  &.m#{$i} {
84
83
  width: $perc;
85
- margin-left: 0;
86
84
  }
87
85
  &.offset-m#{$i} {
88
86
  margin-left: $perc;
@@ -104,7 +102,6 @@
104
102
  $perc: unquote((100 / ($num-cols / $i)) + "%");
105
103
  &.l#{$i} {
106
104
  width: $perc;
107
- margin-left: 0;
108
105
  }
109
106
  &.offset-l#{$i} {
110
107
  margin-left: $perc;
@@ -32,6 +32,7 @@
32
32
  // gradient($default,$start,$stop) *
33
33
  // linear-gradient-top($default,$color1,$stop1,$color2,$stop2,[$color3,$stop3,$color4,$stop4])*
34
34
  // linear-gradient-left($default,$color1,$stop1,$color2,$stop2,[$color3,$stop3,$color4,$stop4])*
35
+ // perspective($pixels)
35
36
  // transform($args)
36
37
  // transform-origin($args)
37
38
  // transform-style($style)
@@ -285,6 +286,13 @@
285
286
  background-image: linear-gradient(left, $color1 $stop1, $color2 $stop2, $color3 $stop3, $color4 $stop4);
286
287
  }
287
288
 
289
+ // Perspective
290
+ @mixin perspective($pixels) {
291
+ perspective: $pixels;
292
+ -webkit-perspective: $pixels;
293
+ }
294
+
295
+
288
296
  // Text Shadow
289
297
 
290
298
  @mixin text-shadow($args) {
@@ -1,6 +1,8 @@
1
1
  .tabs {
2
2
  @include flexbox();
3
3
  position: relative;
4
+ overflow-x: scroll;
5
+ overflow-y: hidden;
4
6
  height: 48px;
5
7
  background-color: $tabs-bg-color;
6
8
  margin: 0 auto;
@@ -51,24 +53,4 @@
51
53
  background-color: $tabs-underline-color;
52
54
  will-change: left, right;
53
55
  }
54
- }
55
-
56
- .hide-tab-scrollbar {
57
- position: relative;
58
- height: 48px;
59
- overflow: hidden;
60
-
61
- .tabs {
62
- overflow-x: scroll;
63
- overflow-y: hidden;
64
- }
65
- }
66
-
67
- // Hacky way to find scrollbar width or height.
68
- .scrollbar-measure {
69
- width: 100px;
70
- height: 100px;
71
- overflow: scroll;
72
- position: absolute;
73
- top: -9999px;
74
- }
56
+ }
@@ -1,3 +1,13 @@
1
+ /*!
2
+ * Materialize v0.97.3 (http://materializecss.com)
3
+ * Copyright 2014-2015 Materialize
4
+ * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
+ */
6
+ /*!
7
+ * Materialize v0.97.2 (http://materializecss.com)
8
+ * Copyright 2014-2015 Materialize
9
+ * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
10
+ */
1
11
  /*!
2
12
  * Materialize v0.97.1 (http://materializecss.com)
3
13
  * Copyright 2014-2015 Materialize
@@ -31,7 +41,7 @@
31
41
  .noUi-origin {
32
42
  position: absolute;
33
43
  right: 0;
34
- top: 0;
44
+ top: 6px;
35
45
  left: 0;
36
46
  bottom: 0;
37
47
  }