materialize-sass 0.95.3.2 → 0.95.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +59 -59
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Bold.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
- data/app/assets/javascripts/materialize-sprockets.js +1 -1
- data/app/assets/javascripts/materialize.js +1 -0
- data/app/assets/javascripts/materialize/{animations.js → animation.js} +1 -0
- data/app/assets/javascripts/materialize/buttons.js +20 -20
- data/app/assets/javascripts/materialize/cards.js +11 -7
- data/app/assets/javascripts/materialize/collapsible.js +1 -1
- data/app/assets/javascripts/materialize/date_picker/picker.date.js +27 -24
- data/app/assets/javascripts/materialize/dropdown.js +17 -15
- data/app/assets/javascripts/materialize/forms.js +41 -19
- data/app/assets/javascripts/materialize/hammer.min.js +1 -1
- data/app/assets/javascripts/materialize/init.js +4 -4
- data/app/assets/javascripts/materialize/jquery.easing.1.3.js +1 -1
- data/app/assets/javascripts/materialize/leanModal.js +68 -23
- data/app/assets/javascripts/materialize/materialbox.js +22 -10
- data/app/assets/javascripts/materialize/parallax.js +10 -1
- data/app/assets/javascripts/materialize/pushpin.js +1 -13
- data/app/assets/javascripts/materialize/scrollFire.js +11 -10
- data/app/assets/javascripts/materialize/scrollspy.js +1 -1
- data/app/assets/javascripts/materialize/sideNav.js +42 -38
- data/app/assets/javascripts/materialize/slider.js +2 -3
- data/app/assets/javascripts/materialize/tabs.js +1 -2
- data/app/assets/javascripts/materialize/tooltip.js +0 -1
- data/app/assets/javascripts/materialize/transitions.js +60 -5
- data/app/assets/javascripts/materialize/velocity.min.js +3 -3
- data/app/assets/stylesheets/materialize/components/_buttons.scss +142 -140
- data/app/assets/stylesheets/materialize/components/_dropdown.scss +1 -0
- data/app/assets/stylesheets/materialize/components/_global.scss +3 -3
- data/app/assets/stylesheets/materialize/components/_grid.scss +2 -2
- data/app/assets/stylesheets/materialize/components/_icons-material-design.scss +5 -5
- data/app/assets/stylesheets/materialize/components/_modal.scss +13 -0
- data/app/assets/stylesheets/materialize/components/_navbar.scss +15 -21
- data/app/assets/stylesheets/materialize/components/_preloader.scss +20 -24
- data/app/assets/stylesheets/materialize/components/_roboto.scss +15 -5
- data/app/assets/stylesheets/materialize/components/_sideNav.scss +1 -0
- data/app/assets/stylesheets/materialize/components/_slider.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_tabs.scss +43 -43
- data/app/assets/stylesheets/materialize/components/_typography.scss +55 -55
- data/app/assets/stylesheets/materialize/components/_variables.scss +11 -11
- data/app/assets/stylesheets/materialize/components/_waves.scss +2 -3
- data/lib/materialize-sass/version.rb +1 -1
- metadata +27 -8
- checksums.yaml +0 -7
data/README.md
CHANGED
@@ -1,59 +1,59 @@
|
|
1
|
-
# Materialize Sass version for Rails Asset Pipeline
|
2
|
-
[](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
|
+
[](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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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
|
@@ -2,33 +2,33 @@
|
|
2
2
|
$(document).ready(function() {
|
3
3
|
|
4
4
|
// jQuery reverse
|
5
|
-
|
5
|
+
$.fn.reverse = [].reverse;
|
6
6
|
|
7
|
-
$('.fixed-action-btn'
|
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
|
15
|
-
$this.
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
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 ));
|
@@ -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
|
-
|
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
|
-
|
1138
|
-
|
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
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
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 ?
|
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('
|
28
|
+
if (origin.data('induration') != undefined)
|
30
29
|
options.inDuration = origin.data('inDuration');
|
31
|
-
if (origin.data('
|
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
|
-
|
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
|
155
|
-
|
156
|
-
e.
|
157
|
-
|
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) &&
|
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 -
|
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
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
-
|
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
|
-
|
82
|
-
|
83
|
-
|
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
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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')
|
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');
|