materialize-sass 0.95.3.2 → 0.95.3.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.
Files changed (54) hide show
  1. data/README.md +59 -59
  2. data/app/assets/fonts/material-design-icons/Material-Design-Icons.woff2 +0 -0
  3. data/app/assets/fonts/roboto/Roboto-Bold.woff +0 -0
  4. data/app/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
  5. data/app/assets/fonts/roboto/Roboto-Light.woff +0 -0
  6. data/app/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
  7. data/app/assets/fonts/roboto/Roboto-Medium.woff +0 -0
  8. data/app/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
  9. data/app/assets/fonts/roboto/Roboto-Regular.woff +0 -0
  10. data/app/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
  11. data/app/assets/fonts/roboto/Roboto-Thin.woff +0 -0
  12. data/app/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
  13. data/app/assets/javascripts/materialize-sprockets.js +1 -1
  14. data/app/assets/javascripts/materialize.js +1 -0
  15. data/app/assets/javascripts/materialize/{animations.js → animation.js} +1 -0
  16. data/app/assets/javascripts/materialize/buttons.js +20 -20
  17. data/app/assets/javascripts/materialize/cards.js +11 -7
  18. data/app/assets/javascripts/materialize/collapsible.js +1 -1
  19. data/app/assets/javascripts/materialize/date_picker/picker.date.js +27 -24
  20. data/app/assets/javascripts/materialize/dropdown.js +17 -15
  21. data/app/assets/javascripts/materialize/forms.js +41 -19
  22. data/app/assets/javascripts/materialize/hammer.min.js +1 -1
  23. data/app/assets/javascripts/materialize/init.js +4 -4
  24. data/app/assets/javascripts/materialize/jquery.easing.1.3.js +1 -1
  25. data/app/assets/javascripts/materialize/leanModal.js +68 -23
  26. data/app/assets/javascripts/materialize/materialbox.js +22 -10
  27. data/app/assets/javascripts/materialize/parallax.js +10 -1
  28. data/app/assets/javascripts/materialize/pushpin.js +1 -13
  29. data/app/assets/javascripts/materialize/scrollFire.js +11 -10
  30. data/app/assets/javascripts/materialize/scrollspy.js +1 -1
  31. data/app/assets/javascripts/materialize/sideNav.js +42 -38
  32. data/app/assets/javascripts/materialize/slider.js +2 -3
  33. data/app/assets/javascripts/materialize/tabs.js +1 -2
  34. data/app/assets/javascripts/materialize/tooltip.js +0 -1
  35. data/app/assets/javascripts/materialize/transitions.js +60 -5
  36. data/app/assets/javascripts/materialize/velocity.min.js +3 -3
  37. data/app/assets/stylesheets/materialize/components/_buttons.scss +142 -140
  38. data/app/assets/stylesheets/materialize/components/_dropdown.scss +1 -0
  39. data/app/assets/stylesheets/materialize/components/_global.scss +3 -3
  40. data/app/assets/stylesheets/materialize/components/_grid.scss +2 -2
  41. data/app/assets/stylesheets/materialize/components/_icons-material-design.scss +5 -5
  42. data/app/assets/stylesheets/materialize/components/_modal.scss +13 -0
  43. data/app/assets/stylesheets/materialize/components/_navbar.scss +15 -21
  44. data/app/assets/stylesheets/materialize/components/_preloader.scss +20 -24
  45. data/app/assets/stylesheets/materialize/components/_roboto.scss +15 -5
  46. data/app/assets/stylesheets/materialize/components/_sideNav.scss +1 -0
  47. data/app/assets/stylesheets/materialize/components/_slider.scss +1 -1
  48. data/app/assets/stylesheets/materialize/components/_tabs.scss +43 -43
  49. data/app/assets/stylesheets/materialize/components/_typography.scss +55 -55
  50. data/app/assets/stylesheets/materialize/components/_variables.scss +11 -11
  51. data/app/assets/stylesheets/materialize/components/_waves.scss +2 -3
  52. data/lib/materialize-sass/version.rb +1 -1
  53. metadata +27 -8
  54. checksums.yaml +0 -7
data/README.md CHANGED
@@ -1,59 +1,59 @@
1
- # Materialize Sass version for Rails Asset Pipeline
2
- [![Gem Version](https://badge.fury.io/rb/materialize-sass.svg)](http://badge.fury.io/rb/materialize-sass)
3
-
4
- `materialize-sass` is a Sass powered version of Materialize, a modern responsive front-end framework based on Material Design.
5
-
6
- ## Installation
7
-
8
- In your Gemfile you need to add the `materialize-sass` gem:
9
-
10
- ```ruby
11
- gem 'materialize-sass'
12
- ```
13
-
14
- **NOTE:** Ensure that the `sass-rails` gem is presented in your Gemfile.
15
-
16
- And then run the bundler and restart your server to make the files available through the pipeline:
17
-
18
- ```console
19
- $ bundle install
20
- ```
21
-
22
- Or install it separately:
23
-
24
- ```console
25
- $ gem install materialize-sass
26
- ```
27
-
28
- ## Usage
29
-
30
- ### a. Sass
31
-
32
- Import Materialize styles in `app/assets/stylesheets/application.css.scss`:
33
-
34
- ```scss
35
- @import "materialize";
36
- ```
37
-
38
- **NOTE:** If you have just generated a new Rails application, it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so remove it.
39
-
40
- ```console
41
- $ rm app/assets/stylesheets/application.css
42
- ```
43
-
44
- ### b. JavaScript
45
-
46
- Require Bootstrap javascripts in `app/assets/javascripts/application.js`:
47
-
48
- ```js
49
- //= require jquery
50
- //= require materialize-sprockets
51
- ```
52
-
53
- ## Contributing
54
-
55
- 1. Fork it ( https://github.com/[my-github-username]/materialize-sass/fork )
56
- 2. Create your feature branch (`git checkout -b my-new-feature`)
57
- 3. Commit your changes (`git commit -am 'Add some feature'`)
58
- 4. Push to the branch (`git push origin my-new-feature`)
59
- 5. Create a new Pull Request
1
+ # Materialize Sass version for Rails Asset Pipeline
2
+ [![Gem Version](https://badge.fury.io/rb/materialize-sass.svg)](http://badge.fury.io/rb/materialize-sass)
3
+
4
+ `materialize-sass` is a Sass powered version of Materialize, a modern responsive front-end framework based on Material Design.
5
+
6
+ ## Installation
7
+
8
+ In your Gemfile you need to add the `materialize-sass` gem:
9
+
10
+ ```ruby
11
+ gem 'materialize-sass'
12
+ ```
13
+
14
+ **NOTE:** Ensure that the `sass-rails` gem is presented in your Gemfile.
15
+
16
+ And then run the bundler and restart your server to make the files available through the pipeline:
17
+
18
+ ```console
19
+ $ bundle install
20
+ ```
21
+
22
+ Or install it separately:
23
+
24
+ ```console
25
+ $ gem install materialize-sass
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ### a. Sass
31
+
32
+ Import Materialize styles in `app/assets/stylesheets/application.css.scss`:
33
+
34
+ ```scss
35
+ @import "materialize";
36
+ ```
37
+
38
+ **NOTE:** If you have just generated a new Rails application, it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so remove it.
39
+
40
+ ```console
41
+ $ rm app/assets/stylesheets/application.css
42
+ ```
43
+
44
+ ### b. JavaScript
45
+
46
+ Require Bootstrap javascripts in `app/assets/javascripts/application.js`:
47
+
48
+ ```js
49
+ //= require jquery
50
+ //= require materialize-sprockets
51
+ ```
52
+
53
+ ## Contributing
54
+
55
+ 1. Fork it ( https://github.com/[my-github-username]/materialize-sass/fork )
56
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
57
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
58
+ 4. Push to the branch (`git push origin my-new-feature`)
59
+ 5. Create a new Pull Request
@@ -1,4 +1,5 @@
1
1
  //= require ./materialize/jquery.easing.1.3
2
+ //= require ./materialize/animation
2
3
  //= require ./materialize/velocity.min
3
4
  //= require ./materialize/hammer.min
4
5
  //= require ./materialize/jquery.hammer
@@ -18,7 +19,6 @@
18
19
  //= require ./materialize/slider
19
20
  //= require ./materialize/cards
20
21
  //= require ./materialize/pushpin
21
- //= require ./materialize/animations
22
22
  //= require ./materialize/buttons
23
23
  //= require ./materialize/transitions
24
24
  //= require ./materialize/date_picker/picker
@@ -5690,3 +5690,4 @@ Picker.extend( 'pickadate', DatePicker )
5690
5690
 
5691
5691
  }));
5692
5692
 
5693
+
@@ -6,3 +6,4 @@
6
6
  return c/4*((t-=2)*t*t + 2) + b;
7
7
  }
8
8
  });
9
+
@@ -2,33 +2,33 @@
2
2
  $(document).ready(function() {
3
3
 
4
4
  // jQuery reverse
5
- jQuery.fn.reverse = [].reverse;
5
+ $.fn.reverse = [].reverse;
6
6
 
7
- $('.fixed-action-btn').each(function (i) {
7
+ $(document).on('mouseenter.fixedActionBtn', '.fixed-action-btn', function(e) {
8
8
  var $this = $(this);
9
+
9
10
  $this.find('ul a.btn-floating').velocity(
10
11
  { scaleY: ".4", scaleX: ".4", translateY: "40px"},
11
12
  { duration: 0 });
12
13
 
14
+ var time = 0;
15
+ $this.find('ul a.btn-floating').reverse().each(function () {
16
+ $(this).velocity(
17
+ { opacity: "1", scaleX: "1", scaleY: "1", translateY: "0"},
18
+ { duration: 80, delay: time });
19
+ time += 40;
20
+ });
21
+
22
+ });
23
+
24
+ $(document).on('mouseleave.fixedActionBtn', '.fixed-action-btn', function(e) {
25
+ var $this = $(this);
13
26
 
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
- );
27
+ var time = 0;
28
+ $this.find('ul a.btn-floating').velocity("stop", true);
29
+ $this.find('ul a.btn-floating').velocity(
30
+ { opacity: "0", scaleX: ".4", scaleY: ".4", translateY: "40px"},
31
+ { duration: 80 });
32
32
  });
33
33
 
34
34
  });
@@ -1,18 +1,22 @@
1
1
  (function ($) {
2
2
  $(document).ready(function() {
3
3
 
4
- $('.card > .card-reveal').each(function() {
5
- $(this).parent().css('overflow', 'hidden');
6
- });
7
-
8
4
  $(document).on('click.card', '.card', function (e) {
9
5
  if ($(this).find('.card-reveal').length) {
10
6
  if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
11
- $(this).find('.card-reveal').velocity({translateY: 0}, {duration: 225, queue: false, easing: 'easeInOutQuad'});
7
+ // Make Reveal animate down and display none
8
+ $(this).find('.card-reveal').velocity(
9
+ {translateY: 0}, {
10
+ duration: 225,
11
+ queue: false,
12
+ easing: 'easeInOutQuad',
13
+ complete: function() { $(this).css({ display: 'none'}) }
14
+ }
15
+ );
12
16
  }
13
17
  else if ($(e.target).is($('.card .activator')) ||
14
18
  $(e.target).is($('.card .activator i')) ) {
15
- $(this).find('.card-reveal').velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});
19
+ $(this).find('.card-reveal').css({ display: 'block'}).velocity("stop", false).velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});
16
20
  }
17
21
  }
18
22
 
@@ -20,4 +24,4 @@
20
24
  });
21
25
 
22
26
  });
23
- }( jQuery ));
27
+ }( jQuery ));
@@ -84,4 +84,4 @@
84
84
  $(document).ready(function(){
85
85
  $('.collapsible').collapsible();
86
86
  });
87
- }( jQuery ));
87
+ }( jQuery ));
@@ -1051,7 +1051,7 @@ DatePicker.prototype.nodes = function( isOpen ) {
1051
1051
  }
1052
1052
 
1053
1053
  // If there are months to select, add a dropdown menu.
1054
- if ( settings.selectMonths ) {
1054
+ if ( settings.selectMonths && override == undefined) {
1055
1055
 
1056
1056
  return _.node( 'select',
1057
1057
  _.group({
@@ -1079,7 +1079,7 @@ DatePicker.prototype.nodes = function( isOpen ) {
1079
1079
  ]
1080
1080
  }
1081
1081
  }),
1082
- settings.klass.selectMonth,
1082
+ settings.klass.selectMonth + ' browser-default',
1083
1083
  ( isOpen ? '' : 'disabled' ) + ' ' +
1084
1084
  _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
1085
1085
  'title="' + settings.labelMonthSelect + '"'
@@ -1088,7 +1088,9 @@ DatePicker.prototype.nodes = function( isOpen ) {
1088
1088
 
1089
1089
  // Materialize modified
1090
1090
  if (override == "short_months")
1091
- return _.node( 'div', monthsCollection[ viewsetObject.month ] )
1091
+ if (selectedObject != null)
1092
+ return _.node( 'div', monthsCollection[ selectedObject.month ] );
1093
+ else return _.node( 'div', monthsCollection[ viewsetObject.month ] );
1092
1094
 
1093
1095
  // If there's a need for a month selector
1094
1096
  return _.node( 'div', monthsCollection[ viewsetObject.month ], settings.klass.month )
@@ -1133,28 +1135,29 @@ DatePicker.prototype.nodes = function( isOpen ) {
1133
1135
  highestYear = maxYear
1134
1136
  }
1135
1137
 
1138
+ if ( settings.selectYears && override == undefined ) {
1139
+ return _.node( 'select',
1140
+ _.group({
1141
+ min: lowestYear,
1142
+ max: highestYear,
1143
+ i: 1,
1144
+ node: 'option',
1145
+ item: function( loopedYear ) {
1146
+ return [
1136
1147
 
1137
- return _.node( 'select',
1138
- _.group({
1139
- min: lowestYear,
1140
- max: highestYear,
1141
- i: 1,
1142
- node: 'option',
1143
- item: function( loopedYear ) {
1144
- return [
1145
-
1146
- // The looped year and no classes.
1147
- loopedYear, 0,
1148
+ // The looped year and no classes.
1149
+ loopedYear, 0,
1148
1150
 
1149
- // Set the value and selected index.
1150
- 'value=' + loopedYear + ( focusedYear == loopedYear ? ' selected' : '' )
1151
- ]
1152
- }
1153
- }),
1154
- settings.klass.selectYear,
1155
- ( isOpen ? '' : 'disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
1156
- 'title="' + settings.labelYearSelect + '"'
1157
- )
1151
+ // Set the value and selected index.
1152
+ 'value=' + loopedYear + ( focusedYear == loopedYear ? ' selected' : '' )
1153
+ ]
1154
+ }
1155
+ }),
1156
+ settings.klass.selectYear + ' browser-default',
1157
+ ( isOpen ? '' : 'disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
1158
+ 'title="' + settings.labelYearSelect + '"'
1159
+ )
1160
+ }
1158
1161
  }
1159
1162
 
1160
1163
  // Materialize modified
@@ -1216,7 +1219,7 @@ return _.node(
1216
1219
  // Calendar container
1217
1220
  _.node('div',
1218
1221
  _.node('div',
1219
- ( settings.selectYears ? createYearLabel() + createMonthLabel() : createMonthLabel() + createYearLabel() ) +
1222
+ ( settings.selectYears ? createMonthLabel() + createYearLabel() : createMonthLabel() + createYearLabel() ) +
1220
1223
  createMonthNav() + createMonthNav( 1 ),
1221
1224
  settings.klass.header
1222
1225
  ) + _.node(
@@ -13,7 +13,6 @@
13
13
  outDuration: 225,
14
14
  constrain_width: true, // Constrains width of dropdown to the activator
15
15
  hover: true,
16
- alignment: 'left',
17
16
  gutter: 0, // Spacing from edge
18
17
  belowOrigin: false
19
18
  }
@@ -26,16 +25,14 @@
26
25
  var activates = $("#"+ origin.attr('data-activates'));
27
26
 
28
27
  function updateOptions() {
29
- if (origin.data('inDuration') != undefined)
28
+ if (origin.data('induration') != undefined)
30
29
  options.inDuration = origin.data('inDuration');
31
- if (origin.data('outDuration') != undefined)
30
+ if (origin.data('outduration') != undefined)
32
31
  options.outDuration = origin.data('outDuration');
33
32
  if (origin.data('constrainwidth') != undefined)
34
33
  options.constrain_width = origin.data('constrainwidth');
35
34
  if (origin.data('hover') != undefined)
36
35
  options.hover = origin.data('hover');
37
- if (origin.data('alignment') != undefined)
38
- options.alignment = origin.data('alignment');
39
36
  if (origin.data('gutter') != undefined)
40
37
  options.gutter = origin.data('gutter');
41
38
  if (origin.data('beloworigin') != undefined)
@@ -67,10 +64,14 @@
67
64
  if (options.belowOrigin == true) {
68
65
  offset = origin.height();
69
66
  }
67
+
70
68
  // Handle edge alignment
69
+ var offsetLeft = origin.offset().left;
70
+
71
71
  var width_difference = 0;
72
72
  var gutter_spacing = options.gutter;
73
- if (options.alignment == 'right') {
73
+
74
+ if (offsetLeft + activates.innerWidth() > $(window).width()) {
74
75
  width_difference = origin.innerWidth() - activates.innerWidth();
75
76
  gutter_spacing = gutter_spacing * -1;
76
77
  }
@@ -151,12 +152,16 @@
151
152
  var open = false;
152
153
 
153
154
  // Click handler to show dropdown
154
- origin.click( function(e){ // Click
155
- e.preventDefault(); // Prevents button click from moving window
156
- e.stopPropagation(); // Allows clicking on icon
157
- placeDropdown();
155
+ origin.unbind('click.' + origin.attr('id'));
156
+ origin.bind('click.'+origin.attr('id'), function(e){
157
+ if (origin[0] == e.currentTarget) {
158
+
159
+ e.preventDefault(); // Prevents button click from moving window
160
+ placeDropdown();
161
+ }
162
+
158
163
  $(document).bind('click.'+ activates.attr('id'), function (e) {
159
- if (!activates.is(e.target) && (!origin.is(e.target))) {
164
+ if (!activates.is(e.target) && !origin.is(e.target) && (!origin.find(e.target).length > 0) ) {
160
165
  hideDropdown();
161
166
  $(document).unbind('click.' + activates.attr('id'));
162
167
  }
@@ -165,14 +170,11 @@
165
170
 
166
171
  } // End else
167
172
 
168
- // Listen to open and close event - usefull for select component
173
+ // Listen to open and close event - useful for select component
169
174
  origin.on('open', placeDropdown);
170
175
  origin.on('close', hideDropdown);
171
176
 
172
- // Window Resize Reposition
173
- $(document).on('resize', function(){
174
177
 
175
- });
176
178
  });
177
179
  }; // End dropdown plugin
178
180
  }( jQuery ));
@@ -69,30 +69,41 @@
69
69
 
70
70
 
71
71
  // Textarea Auto Resize
72
- if ($('.hiddendiv').length === 0) {
73
- var hiddenDiv = $('<div class="hiddendiv common"></div>'),
74
- content = null;
75
- $('body').append(hiddenDiv);
72
+ var hiddenDiv = $('.hiddendiv').first();
73
+ if (!hiddenDiv.length) {
74
+ hiddenDiv = $('<div class="hiddendiv common"></div>');
75
+ $('body').append(hiddenDiv);
76
76
  }
77
77
  var text_area_selector = '.materialize-textarea';
78
- $('.hiddendiv').css('width', $(text_area_selector).width());
78
+
79
+ function textareaAutoResize($textarea) {
80
+ hiddenDiv.text($textarea.val() + '\n');
81
+ var content = hiddenDiv.html().replace(/\n/g, '<br>');
82
+ hiddenDiv.html(content);
83
+
84
+ // When textarea is hidden, width goes crazy.
85
+ // Approximate with half of window size
86
+
87
+ if ($textarea.is(':visible')) {
88
+ hiddenDiv.css('width', $textarea.width());
89
+ }
90
+ else {
91
+ hiddenDiv.css('width', $(window).width()/2);
92
+ }
93
+
94
+ $textarea.css('height', hiddenDiv.height());
95
+ }
79
96
 
80
97
  $(text_area_selector).each(function () {
81
- if ($(this).val().length) {
82
- content = $(this).val();
83
- content = content.replace(/\n/g, '<br>');
84
- hiddenDiv.html(content + '<br>');
85
- $(this).css('height', hiddenDiv.height());
98
+ var $textarea = $(this);
99
+ if ($textarea.val().length) {
100
+ textareaAutoResize($textarea);
86
101
  }
87
102
  });
88
- $('body').on('keyup keydown',text_area_selector , function () {
89
- // console.log($(this).val());
90
- content = $(this).val();
91
- content = content.replace(/\n/g, '<br>');
92
- hiddenDiv.html(content + '<br>');
93
- // console.log(hiddenDiv.html());
94
- $(this).css('height', hiddenDiv.height());
95
- });
103
+
104
+ $('body').on('keyup keydown', text_area_selector, function () {
105
+ textareaAutoResize($(this));
106
+ });
96
107
 
97
108
 
98
109
  // File Input Path
@@ -187,11 +198,22 @@
187
198
  $(this).each(function(){
188
199
  $select = $(this);
189
200
 
190
- if ( $select.hasClass('browser-default') || $select.hasClass('initialized')) {
201
+ if ( $select.hasClass('browser-default')) {
191
202
  return; // Continue to next (return false breaks out of entire loop)
192
203
  }
193
204
 
205
+ // Tear down structure if Select needs to be rebuilt
206
+ var lastID = $select.data('select-id');
207
+ if (lastID) {
208
+ $select.parent().find('i').remove();
209
+ $select.parent().find('input').remove();
210
+
211
+ $select.unwrap();
212
+ $('ul#select-options-'+lastID).remove();
213
+ }
214
+
194
215
  var uniqueID = guid();
216
+ $select.data('select-id', uniqueID);
195
217
  var wrapper = $('<div class="select-wrapper"></div>');
196
218
  var options = $('<ul id="select-options-' + uniqueID+'" class="dropdown-content select-dropdown"></ul>');
197
219
  var selectOptions = $select.children('option');