material_design_lite-sass 1.2.1 → 1.3.0
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/.travis.yml +3 -4
- data/CHANGELOG.md +10 -1
- data/README.md +12 -23
- data/lib/material_design_lite/sass/version.rb +1 -1
- data/material_design_lite-sass.gemspec +4 -3
- data/vendor/assets/javascripts/material.js +60 -41
- data/vendor/assets/javascripts/material/layout.js +10 -6
- data/vendor/assets/javascripts/material/mdlComponentHandler.js +31 -19
- data/vendor/assets/javascripts/material/rAF.js +34 -34
- data/vendor/assets/javascripts/material/radio.js +3 -1
- data/vendor/assets/javascripts/material/ripple.js +2 -2
- data/vendor/assets/javascripts/material/tabs.js +9 -7
- data/vendor/assets/stylesheets/material/_card.scss +4 -0
- data/vendor/assets/stylesheets/material/_radio.scss +5 -2
- data/vendor/assets/stylesheets/material/_spinner.scss +8 -0
- metadata +27 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a60d881418b9db93f9afa2f12c9f31453940324b
|
|
4
|
+
data.tar.gz: 93d8347c3cd62ca65735e8a4e9d77eed1bb11a65
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0866bf3ca16dfc8c3d81d32da13c6eab84b36d9ce69eaf59113279efc3d09828e3bf389a9af433fb23868cd36b8fbe67eee5b030ef591e2a0c7887ebfa9dceaf'
|
|
7
|
+
data.tar.gz: f2b145ce02704a5076ea05086d6970f360d8383574be29bd042e14236828893d80a775b56887953fed2522393e282fbed4606429c6674412a95bc93917a6f0a8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 1.3.0 (2016-12-22)
|
|
2
|
+
|
|
3
|
+
- Update assets to match upstream version
|
|
4
|
+
|
|
5
|
+
Library version:
|
|
6
|
+
|
|
7
|
+
- Material Design Lite v1.3.0
|
|
8
|
+
- Material Icons v3.0.0
|
|
9
|
+
|
|
1
10
|
## 1.2.1 (2016-09-09)
|
|
2
11
|
|
|
3
12
|
- Update assets to match upstream version
|
|
@@ -166,4 +175,4 @@ Library version: Material Design Lite v1.0.2
|
|
|
166
175
|
|
|
167
176
|
- Initial release
|
|
168
177
|
|
|
169
|
-
Library version: Material Design Lite v1.0.1
|
|
178
|
+
Library version: Material Design Lite v1.0.1
|
data/README.md
CHANGED
|
@@ -3,13 +3,7 @@
|
|
|
3
3
|
[](http://badge.fury.io/rb/material_design_lite-sass)
|
|
4
4
|
[](https://travis-ci.org/rubysamurai/material_design_lite-sass)
|
|
5
5
|
|
|
6
|
-
[Material Design Lite](http://www.getmdl.io/)
|
|
7
|
-
|
|
8
|
-
`material_design_lite-sass` is a Sass-powered version of Material Design Lite for your applications. It allows to include all of Material Design Lite components at once or load them individually.
|
|
9
|
-
|
|
10
|
-
`material_design_lite-sass` includes [Material Icons](https://www.google.com/design/icons/), official icon set from Google, designed under the material design guidelines.
|
|
11
|
-
|
|
12
|
-
[Roboto](https://www.google.com/fonts/specimen/Roboto) font, the recommended font for Google’s visual language, Material Design, is also included.
|
|
6
|
+
`material_design_lite-sass` is a Sass-powered version of [Material Design Lite](http://www.getmdl.io/) for your Ruby applications. In addition to all of Material Design Lite components it includes [Material Icons](https://material.io/icons/), official icon set from Google, and [Roboto](https://fonts.google.com/specimen/Roboto) font, the recommended font for material design.
|
|
13
7
|
|
|
14
8
|
## Installation
|
|
15
9
|
|
|
@@ -29,13 +23,14 @@ Open `/app/assets/stylesheets/application.scss` file and add this line:
|
|
|
29
23
|
@import 'material';
|
|
30
24
|
```
|
|
31
25
|
|
|
32
|
-
> **Note:** Default Rails installation comes with `.css` file extension for stylesheet
|
|
26
|
+
> **Note:** Default Rails installation comes with `.css` file extension for stylesheet assets files, make sure you change it to `.scss` and remove all the `*= require_tree .` and `*= require_self` statements from file. Alternatively, to keep original `application.css` file, you can create `custom.scss` file in the same folder and import `material` there.
|
|
33
27
|
|
|
34
28
|
Open `app/assets/javascripts/application.js` file and add this line:
|
|
35
29
|
|
|
36
30
|
```
|
|
37
31
|
//= require material
|
|
38
32
|
```
|
|
33
|
+
|
|
39
34
|
Restart Rails web server if it was running and now your Rails application is powered by Sass version of Material Design Lite.
|
|
40
35
|
|
|
41
36
|
#### Turbolinks
|
|
@@ -62,7 +57,7 @@ Put this code, for instance, in `app/assets/javascripts/application.js` file or
|
|
|
62
57
|
|
|
63
58
|
## Usage
|
|
64
59
|
|
|
65
|
-
By default, using `@import 'material';` and `//= require material`, all of Material Design Lite components are imported.
|
|
60
|
+
By default, using `@import 'material';` and `//= require material`, all of Material Design Lite components are imported.
|
|
66
61
|
|
|
67
62
|
To import specific JavaScript components, first you need to include support components:
|
|
68
63
|
|
|
@@ -71,7 +66,7 @@ To import specific JavaScript components, first you need to include support comp
|
|
|
71
66
|
//= require material/rAF
|
|
72
67
|
```
|
|
73
68
|
|
|
74
|
-
Then include
|
|
69
|
+
Then include any Material Design Lite JavaScript component:
|
|
75
70
|
|
|
76
71
|
```
|
|
77
72
|
//= require material/button
|
|
@@ -149,11 +144,11 @@ For browsers that do not support ligatures, fall back to specifying the icons us
|
|
|
149
144
|
<i class="material-icons"></i>
|
|
150
145
|
```
|
|
151
146
|
|
|
152
|
-
Complete list of Material Icon names and codepoints can be found [here](https://
|
|
147
|
+
Complete list of Material Icon names and codepoints can be found [here](https://material.io/icons/)
|
|
153
148
|
|
|
154
149
|
### Variables
|
|
155
150
|
|
|
156
|
-
Sass version provides many variables to make customization process convenient. The full set of Material Design Lite variables can be found [here](
|
|
151
|
+
Sass version provides many variables to make customization process convenient. The full set of Material Design Lite variables can be found [here](vendor/assets/stylesheets/material/_variables.scss).
|
|
157
152
|
|
|
158
153
|
To override the variable it must be redefined before the `@import` directive, like this:
|
|
159
154
|
|
|
@@ -162,28 +157,22 @@ $layout-header-bg-color: rgb(128,128,128) !default;
|
|
|
162
157
|
@import 'material';
|
|
163
158
|
```
|
|
164
159
|
|
|
165
|
-
>**Note on Sass color variables:** All Material Design Lite color variables are defined with RGB values, overriding these variables with hexadecimal color values may result in unexpected
|
|
160
|
+
>**Note on Sass color variables:** All Material Design Lite color variables are defined with RGB values, overriding these variables with hexadecimal color values may result in unexpected behavior.
|
|
166
161
|
|
|
167
162
|
## Versioning
|
|
168
163
|
|
|
169
164
|
Material Design Lite for Sass follows the upstream version of Google's Material Design Lite. But last version number may be ahead, in case there is a need to release project specific changes.
|
|
170
165
|
|
|
171
|
-
Please always refer to the [CHANGELOG](https://github.com/rubysamurai/material_design_lite-sass/blob/master/CHANGELOG.md) when upgrading.
|
|
172
|
-
|
|
173
|
-
## Contributing
|
|
174
|
-
|
|
175
|
-
Anyone is welcome to contribute to Material Design Lite for Sass. Please [raise an issue](https://github.com/rubysamurai/material_design_lite-sass/issues), fork the project, make changes to your forked repository and submit a pull request.
|
|
176
|
-
|
|
177
166
|
## Credits
|
|
178
167
|
|
|
179
168
|
Material Design Lite for Sass is inspired from [bootstrap-sass](https://github.com/twbs/bootstrap-sass) by Bootstrap team.
|
|
180
169
|
|
|
181
170
|
## License
|
|
182
171
|
|
|
183
|
-
Material Design Lite © Google
|
|
172
|
+
Material Design Lite © Google. Licensed under the [Apache-2](http://www.apache.org/licenses/LICENSE-2.0.html) license.
|
|
184
173
|
|
|
185
|
-
Material Icons © Google
|
|
174
|
+
Material Icons © Google. Licensed under the [Apache-2](http://www.apache.org/licenses/LICENSE-2.0.html) license.
|
|
186
175
|
|
|
187
|
-
Roboto © Google
|
|
176
|
+
Roboto © Google. Licensed under the [Apache-2](http://www.apache.org/licenses/LICENSE-2.0.html) license.
|
|
188
177
|
|
|
189
|
-
`material_design_lite-sass` © Dmitriy Tarasov
|
|
178
|
+
`material_design_lite-sass` © Dmitriy Tarasov. Released under the [MIT](LICENSE.txt) license.
|
|
@@ -21,9 +21,10 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
|
|
22
22
|
spec.required_ruby_version = '>= 2.0.0'
|
|
23
23
|
|
|
24
|
-
spec.add_runtime_dependency 'sass', '~> 3.3'
|
|
25
24
|
spec.add_runtime_dependency 'autoprefixer-rails', '~> 6.0'
|
|
25
|
+
spec.add_runtime_dependency 'sass', '~> 3.3'
|
|
26
26
|
|
|
27
|
-
spec.add_development_dependency '
|
|
28
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
|
27
|
+
spec.add_development_dependency 'railties', '~> 5.0'
|
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.5'
|
|
29
|
+
spec.add_development_dependency 'sprockets-rails', '~> 3.0'
|
|
29
30
|
end
|
|
@@ -144,6 +144,27 @@ componentHandler = (function() {
|
|
|
144
144
|
return upgradedList.indexOf(jsClass) !== -1;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
/**
|
|
148
|
+
* Create an event object.
|
|
149
|
+
*
|
|
150
|
+
* @param {string} eventType The type name of the event.
|
|
151
|
+
* @param {boolean} bubbles Whether the event should bubble up the DOM.
|
|
152
|
+
* @param {boolean} cancelable Whether the event can be canceled.
|
|
153
|
+
* @returns {!Event}
|
|
154
|
+
*/
|
|
155
|
+
function createEvent_(eventType, bubbles, cancelable) {
|
|
156
|
+
if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {
|
|
157
|
+
return new CustomEvent(eventType, {
|
|
158
|
+
bubbles: bubbles,
|
|
159
|
+
cancelable: cancelable
|
|
160
|
+
});
|
|
161
|
+
} else {
|
|
162
|
+
var ev = document.createEvent('Events');
|
|
163
|
+
ev.initEvent(eventType, bubbles, cancelable);
|
|
164
|
+
return ev;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
147
168
|
/**
|
|
148
169
|
* Searches existing DOM for elements of our component type and upgrades them
|
|
149
170
|
* if they have not already been upgraded.
|
|
@@ -188,6 +209,13 @@ componentHandler = (function() {
|
|
|
188
209
|
if (!(typeof element === 'object' && element instanceof Element)) {
|
|
189
210
|
throw new Error('Invalid argument provided to upgrade MDL element.');
|
|
190
211
|
}
|
|
212
|
+
// Allow upgrade to be canceled by canceling emitted event.
|
|
213
|
+
var upgradingEv = createEvent_('mdl-componentupgrading', true, true);
|
|
214
|
+
element.dispatchEvent(upgradingEv);
|
|
215
|
+
if (upgradingEv.defaultPrevented) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
|
|
191
219
|
var upgradedList = getUpgradedListOfElement_(element);
|
|
192
220
|
var classesToUpgrade = [];
|
|
193
221
|
// If jsClass is not provided scan the registered components to find the
|
|
@@ -230,16 +258,8 @@ componentHandler = (function() {
|
|
|
230
258
|
'Unable to find a registered component for the given class.');
|
|
231
259
|
}
|
|
232
260
|
|
|
233
|
-
var
|
|
234
|
-
|
|
235
|
-
ev = new CustomEvent('mdl-componentupgraded', {
|
|
236
|
-
bubbles: true, cancelable: false
|
|
237
|
-
});
|
|
238
|
-
} else {
|
|
239
|
-
ev = document.createEvent('Events');
|
|
240
|
-
ev.initEvent('mdl-componentupgraded', true, true);
|
|
241
|
-
}
|
|
242
|
-
element.dispatchEvent(ev);
|
|
261
|
+
var upgradedEv = createEvent_('mdl-componentupgraded', true, false);
|
|
262
|
+
element.dispatchEvent(upgradedEv);
|
|
243
263
|
}
|
|
244
264
|
}
|
|
245
265
|
|
|
@@ -361,15 +381,7 @@ componentHandler = (function() {
|
|
|
361
381
|
upgrades.splice(componentPlace, 1);
|
|
362
382
|
component.element_.setAttribute('data-upgraded', upgrades.join(','));
|
|
363
383
|
|
|
364
|
-
var ev;
|
|
365
|
-
if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {
|
|
366
|
-
ev = new CustomEvent('mdl-componentdowngraded', {
|
|
367
|
-
bubbles: true, cancelable: false
|
|
368
|
-
});
|
|
369
|
-
} else {
|
|
370
|
-
ev = document.createEvent('Events');
|
|
371
|
-
ev.initEvent('mdl-componentdowngraded', true, true);
|
|
372
|
-
}
|
|
384
|
+
var ev = createEvent_('mdl-componentdowngraded', true, false);
|
|
373
385
|
component.element_.dispatchEvent(ev);
|
|
374
386
|
}
|
|
375
387
|
}
|
|
@@ -502,9 +514,9 @@ window.addEventListener('load', function() {
|
|
|
502
514
|
// MIT license
|
|
503
515
|
if (!Date.now) {
|
|
504
516
|
/**
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
517
|
+
* Date.now polyfill.
|
|
518
|
+
* @return {number} the current Date
|
|
519
|
+
*/
|
|
508
520
|
Date.now = function () {
|
|
509
521
|
return new Date().getTime();
|
|
510
522
|
};
|
|
@@ -524,9 +536,9 @@ for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
|
|
|
524
536
|
if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
|
|
525
537
|
var lastTime = 0;
|
|
526
538
|
/**
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
539
|
+
* requestAnimationFrame polyfill.
|
|
540
|
+
* @param {!Function} callback the callback function.
|
|
541
|
+
*/
|
|
530
542
|
window.requestAnimationFrame = function (callback) {
|
|
531
543
|
var now = Date.now();
|
|
532
544
|
var nextTime = Math.max(lastTime + 16, now);
|
|
@@ -1688,7 +1700,9 @@ MaterialRadio.prototype.onChange_ = function (event) {
|
|
|
1688
1700
|
var button = radios[i].querySelector('.' + this.CssClasses_.RADIO_BTN);
|
|
1689
1701
|
// Different name == different group, so no point updating those.
|
|
1690
1702
|
if (button.getAttribute('name') === this.btnElement_.getAttribute('name')) {
|
|
1691
|
-
radios[i]['MaterialRadio']
|
|
1703
|
+
if (typeof radios[i]['MaterialRadio'] !== 'undefined') {
|
|
1704
|
+
radios[i]['MaterialRadio'].updateClasses_();
|
|
1705
|
+
}
|
|
1692
1706
|
}
|
|
1693
1707
|
}
|
|
1694
1708
|
};
|
|
@@ -2717,13 +2731,15 @@ function MaterialTab(tab, ctx) {
|
|
|
2717
2731
|
tab.appendChild(rippleContainer);
|
|
2718
2732
|
}
|
|
2719
2733
|
tab.addEventListener('click', function (e) {
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2734
|
+
if (tab.getAttribute('href').charAt(0) === '#') {
|
|
2735
|
+
e.preventDefault();
|
|
2736
|
+
var href = tab.href.split('#')[1];
|
|
2737
|
+
var panel = ctx.element_.querySelector('#' + href);
|
|
2738
|
+
ctx.resetTabState_();
|
|
2739
|
+
ctx.resetPanelState_();
|
|
2740
|
+
tab.classList.add(ctx.CssClasses_.ACTIVE_CLASS);
|
|
2741
|
+
panel.classList.add(ctx.CssClasses_.ACTIVE_CLASS);
|
|
2742
|
+
}
|
|
2727
2743
|
});
|
|
2728
2744
|
}
|
|
2729
2745
|
}
|
|
@@ -3212,6 +3228,7 @@ MaterialLayout.prototype.CssClasses_ = {
|
|
|
3212
3228
|
TAB_BAR_BUTTON: 'mdl-layout__tab-bar-button',
|
|
3213
3229
|
TAB_BAR_LEFT_BUTTON: 'mdl-layout__tab-bar-left-button',
|
|
3214
3230
|
TAB_BAR_RIGHT_BUTTON: 'mdl-layout__tab-bar-right-button',
|
|
3231
|
+
TAB_MANUAL_SWITCH: 'mdl-layout__tab-manual-switch',
|
|
3215
3232
|
PANEL: 'mdl-layout__tab-panel',
|
|
3216
3233
|
HAS_DRAWER: 'has-drawer',
|
|
3217
3234
|
HAS_TABS: 'has-tabs',
|
|
@@ -3575,12 +3592,14 @@ function MaterialLayoutTab(tab, tabs, panels, layout) {
|
|
|
3575
3592
|
rippleContainer.appendChild(ripple);
|
|
3576
3593
|
tab.appendChild(rippleContainer);
|
|
3577
3594
|
}
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3595
|
+
if (!layout.tabBar_.classList.contains(layout.CssClasses_.TAB_MANUAL_SWITCH)) {
|
|
3596
|
+
tab.addEventListener('click', function (e) {
|
|
3597
|
+
if (tab.getAttribute('href').charAt(0) === '#') {
|
|
3598
|
+
e.preventDefault();
|
|
3599
|
+
selectTab();
|
|
3600
|
+
}
|
|
3601
|
+
});
|
|
3602
|
+
}
|
|
3584
3603
|
tab.show = selectTab;
|
|
3585
3604
|
}
|
|
3586
3605
|
window['MaterialLayoutTab'] = MaterialLayoutTab;
|
|
@@ -3841,8 +3860,8 @@ MaterialRipple.prototype.downHandler_ = function (event) {
|
|
|
3841
3860
|
x = Math.round(bound.width / 2);
|
|
3842
3861
|
y = Math.round(bound.height / 2);
|
|
3843
3862
|
} else {
|
|
3844
|
-
var clientX = event.clientX ? event.clientX : event.touches[0].clientX;
|
|
3845
|
-
var clientY = event.clientY ? event.clientY : event.touches[0].clientY;
|
|
3863
|
+
var clientX = event.clientX !== undefined ? event.clientX : event.touches[0].clientX;
|
|
3864
|
+
var clientY = event.clientY !== undefined ? event.clientY : event.touches[0].clientY;
|
|
3846
3865
|
x = Math.round(clientX - bound.left);
|
|
3847
3866
|
y = Math.round(clientY - bound.top);
|
|
3848
3867
|
}
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
TAB_BAR_BUTTON: 'mdl-layout__tab-bar-button',
|
|
111
111
|
TAB_BAR_LEFT_BUTTON: 'mdl-layout__tab-bar-left-button',
|
|
112
112
|
TAB_BAR_RIGHT_BUTTON: 'mdl-layout__tab-bar-right-button',
|
|
113
|
+
TAB_MANUAL_SWITCH: 'mdl-layout__tab-manual-switch',
|
|
113
114
|
PANEL: 'mdl-layout__tab-panel',
|
|
114
115
|
|
|
115
116
|
HAS_DRAWER: 'has-drawer',
|
|
@@ -549,12 +550,15 @@
|
|
|
549
550
|
tab.appendChild(rippleContainer);
|
|
550
551
|
}
|
|
551
552
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
553
|
+
if (!layout.tabBar_.classList.contains(
|
|
554
|
+
layout.CssClasses_.TAB_MANUAL_SWITCH)) {
|
|
555
|
+
tab.addEventListener('click', function(e) {
|
|
556
|
+
if (tab.getAttribute('href').charAt(0) === '#') {
|
|
557
|
+
e.preventDefault();
|
|
558
|
+
selectTab();
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
}
|
|
558
562
|
|
|
559
563
|
tab.show = selectTab;
|
|
560
564
|
}
|
|
@@ -141,6 +141,27 @@ componentHandler = (function() {
|
|
|
141
141
|
return upgradedList.indexOf(jsClass) !== -1;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Create an event object.
|
|
146
|
+
*
|
|
147
|
+
* @param {string} eventType The type name of the event.
|
|
148
|
+
* @param {boolean} bubbles Whether the event should bubble up the DOM.
|
|
149
|
+
* @param {boolean} cancelable Whether the event can be canceled.
|
|
150
|
+
* @returns {!Event}
|
|
151
|
+
*/
|
|
152
|
+
function createEvent_(eventType, bubbles, cancelable) {
|
|
153
|
+
if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {
|
|
154
|
+
return new CustomEvent(eventType, {
|
|
155
|
+
bubbles: bubbles,
|
|
156
|
+
cancelable: cancelable
|
|
157
|
+
});
|
|
158
|
+
} else {
|
|
159
|
+
var ev = document.createEvent('Events');
|
|
160
|
+
ev.initEvent(eventType, bubbles, cancelable);
|
|
161
|
+
return ev;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
144
165
|
/**
|
|
145
166
|
* Searches existing DOM for elements of our component type and upgrades them
|
|
146
167
|
* if they have not already been upgraded.
|
|
@@ -185,6 +206,13 @@ componentHandler = (function() {
|
|
|
185
206
|
if (!(typeof element === 'object' && element instanceof Element)) {
|
|
186
207
|
throw new Error('Invalid argument provided to upgrade MDL element.');
|
|
187
208
|
}
|
|
209
|
+
// Allow upgrade to be canceled by canceling emitted event.
|
|
210
|
+
var upgradingEv = createEvent_('mdl-componentupgrading', true, true);
|
|
211
|
+
element.dispatchEvent(upgradingEv);
|
|
212
|
+
if (upgradingEv.defaultPrevented) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
|
|
188
216
|
var upgradedList = getUpgradedListOfElement_(element);
|
|
189
217
|
var classesToUpgrade = [];
|
|
190
218
|
// If jsClass is not provided scan the registered components to find the
|
|
@@ -227,16 +255,8 @@ componentHandler = (function() {
|
|
|
227
255
|
'Unable to find a registered component for the given class.');
|
|
228
256
|
}
|
|
229
257
|
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
-
ev = new CustomEvent('mdl-componentupgraded', {
|
|
233
|
-
bubbles: true, cancelable: false
|
|
234
|
-
});
|
|
235
|
-
} else {
|
|
236
|
-
ev = document.createEvent('Events');
|
|
237
|
-
ev.initEvent('mdl-componentupgraded', true, true);
|
|
238
|
-
}
|
|
239
|
-
element.dispatchEvent(ev);
|
|
258
|
+
var upgradedEv = createEvent_('mdl-componentupgraded', true, false);
|
|
259
|
+
element.dispatchEvent(upgradedEv);
|
|
240
260
|
}
|
|
241
261
|
}
|
|
242
262
|
|
|
@@ -358,15 +378,7 @@ componentHandler = (function() {
|
|
|
358
378
|
upgrades.splice(componentPlace, 1);
|
|
359
379
|
component.element_.setAttribute('data-upgraded', upgrades.join(','));
|
|
360
380
|
|
|
361
|
-
var ev;
|
|
362
|
-
if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {
|
|
363
|
-
ev = new CustomEvent('mdl-componentdowngraded', {
|
|
364
|
-
bubbles: true, cancelable: false
|
|
365
|
-
});
|
|
366
|
-
} else {
|
|
367
|
-
ev = document.createEvent('Events');
|
|
368
|
-
ev.initEvent('mdl-componentdowngraded', true, true);
|
|
369
|
-
}
|
|
381
|
+
var ev = createEvent_('mdl-componentdowngraded', true, false);
|
|
370
382
|
component.element_.dispatchEvent(ev);
|
|
371
383
|
}
|
|
372
384
|
}
|
|
@@ -9,42 +9,42 @@
|
|
|
9
9
|
// MIT license
|
|
10
10
|
|
|
11
11
|
(function() {
|
|
12
|
-
'use strict';
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
|
-
if (!Date.now) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
14
|
+
if (!Date.now) {
|
|
15
|
+
/**
|
|
16
|
+
* Date.now polyfill.
|
|
17
|
+
* @return {number} the current Date
|
|
18
|
+
*/
|
|
19
|
+
Date.now = function() { return new Date().getTime(); };
|
|
20
|
+
Date['now'] = Date.now;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
var vendors = ['webkit', 'moz'];
|
|
24
|
-
for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
23
|
+
var vendors = ['webkit', 'moz'];
|
|
24
|
+
for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
|
|
25
|
+
var vp = vendors[i];
|
|
26
|
+
window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
|
|
27
|
+
window.cancelAnimationFrame = (window[vp + 'CancelAnimationFrame'] ||
|
|
28
|
+
window[vp + 'CancelRequestAnimationFrame']);
|
|
29
|
+
window['requestAnimationFrame'] = window.requestAnimationFrame;
|
|
30
|
+
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
33
|
+
if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
|
|
34
|
+
var lastTime = 0;
|
|
35
|
+
/**
|
|
36
|
+
* requestAnimationFrame polyfill.
|
|
37
|
+
* @param {!Function} callback the callback function.
|
|
38
|
+
*/
|
|
39
|
+
window.requestAnimationFrame = function(callback) {
|
|
40
|
+
var now = Date.now();
|
|
41
|
+
var nextTime = Math.max(lastTime + 16, now);
|
|
42
|
+
return setTimeout(function() { callback(lastTime = nextTime); },
|
|
43
|
+
nextTime - now);
|
|
44
|
+
};
|
|
45
|
+
window.cancelAnimationFrame = clearTimeout;
|
|
46
|
+
window['requestAnimationFrame'] = window.requestAnimationFrame;
|
|
47
|
+
window['cancelAnimationFrame'] = window.cancelAnimationFrame;
|
|
48
|
+
}
|
|
49
49
|
|
|
50
50
|
})();
|
|
@@ -82,7 +82,9 @@
|
|
|
82
82
|
var button = radios[i].querySelector('.' + this.CssClasses_.RADIO_BTN);
|
|
83
83
|
// Different name == different group, so no point updating those.
|
|
84
84
|
if (button.getAttribute('name') === this.btnElement_.getAttribute('name')) {
|
|
85
|
-
radios[i]['MaterialRadio']
|
|
85
|
+
if (typeof radios[i]['MaterialRadio'] !== 'undefined') {
|
|
86
|
+
radios[i]['MaterialRadio'].updateClasses_();
|
|
87
|
+
}
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
};
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
x = Math.round(bound.width / 2);
|
|
103
103
|
y = Math.round(bound.height / 2);
|
|
104
104
|
} else {
|
|
105
|
-
var clientX = event.clientX ? event.clientX : event.touches[0].clientX;
|
|
106
|
-
var clientY = event.clientY ? event.clientY : event.touches[0].clientY;
|
|
105
|
+
var clientX = event.clientX !== undefined ? event.clientX : event.touches[0].clientX;
|
|
106
|
+
var clientY = event.clientY !== undefined ? event.clientY : event.touches[0].clientY;
|
|
107
107
|
x = Math.round(clientX - bound.left);
|
|
108
108
|
y = Math.round(clientY - bound.top);
|
|
109
109
|
}
|
|
@@ -140,13 +140,15 @@
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
tab.addEventListener('click', function(e) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
if (tab.getAttribute('href').charAt(0) === '#') {
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
var href = tab.href.split('#')[1];
|
|
146
|
+
var panel = ctx.element_.querySelector('#' + href);
|
|
147
|
+
ctx.resetTabState_();
|
|
148
|
+
ctx.resetPanelState_();
|
|
149
|
+
tab.classList.add(ctx.CssClasses_.ACTIVE_CLASS);
|
|
150
|
+
panel.classList.add(ctx.CssClasses_.ACTIVE_CLASS);
|
|
151
|
+
}
|
|
150
152
|
});
|
|
151
153
|
|
|
152
154
|
}
|
|
@@ -25,7 +25,10 @@
|
|
|
25
25
|
|
|
26
26
|
display: inline-block;
|
|
27
27
|
|
|
28
|
+
vertical-align: middle;
|
|
29
|
+
|
|
28
30
|
box-sizing: border-box;
|
|
31
|
+
height: $radio-label-height;
|
|
29
32
|
margin: 0;
|
|
30
33
|
padding-left: 0;
|
|
31
34
|
|
|
@@ -98,13 +101,13 @@
|
|
|
98
101
|
|
|
99
102
|
@include material-animation-default(0.28s);
|
|
100
103
|
transition-property: transform;
|
|
101
|
-
transform:
|
|
104
|
+
transform: scale(0, 0);
|
|
102
105
|
|
|
103
106
|
border-radius: 50%;
|
|
104
107
|
background: $radio-color;
|
|
105
108
|
|
|
106
109
|
.mdl-radio.is-checked & {
|
|
107
|
-
transform:
|
|
110
|
+
transform: scale(1, 1);
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
fieldset[disabled] .mdl-radio &,
|
metadata
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: material_design_lite-sass
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitriy Tarasov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-12-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: autoprefixer-rails
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '6.0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '6.0'
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
name: sass
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -25,47 +39,47 @@ dependencies:
|
|
|
25
39
|
- !ruby/object:Gem::Version
|
|
26
40
|
version: '3.3'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
42
|
+
name: railties
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
30
44
|
requirements:
|
|
31
45
|
- - "~>"
|
|
32
46
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
34
|
-
type: :
|
|
47
|
+
version: '5.0'
|
|
48
|
+
type: :development
|
|
35
49
|
prerelease: false
|
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
51
|
requirements:
|
|
38
52
|
- - "~>"
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
54
|
+
version: '5.0'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
56
|
+
name: rspec
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
44
58
|
requirements:
|
|
45
59
|
- - "~>"
|
|
46
60
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
61
|
+
version: '3.5'
|
|
48
62
|
type: :development
|
|
49
63
|
prerelease: false
|
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
65
|
requirements:
|
|
52
66
|
- - "~>"
|
|
53
67
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
68
|
+
version: '3.5'
|
|
55
69
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
70
|
+
name: sprockets-rails
|
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
|
58
72
|
requirements:
|
|
59
73
|
- - "~>"
|
|
60
74
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '3.
|
|
75
|
+
version: '3.0'
|
|
62
76
|
type: :development
|
|
63
77
|
prerelease: false
|
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
79
|
requirements:
|
|
66
80
|
- - "~>"
|
|
67
81
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '3.
|
|
82
|
+
version: '3.0'
|
|
69
83
|
description: Google's Material Design Lite with Material Icons and Roboto for Sass
|
|
70
84
|
powered applications
|
|
71
85
|
email:
|
|
@@ -189,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
189
203
|
version: '0'
|
|
190
204
|
requirements: []
|
|
191
205
|
rubyforge_project:
|
|
192
|
-
rubygems_version: 2.5.
|
|
206
|
+
rubygems_version: 2.5.2
|
|
193
207
|
signing_key:
|
|
194
208
|
specification_version: 4
|
|
195
209
|
summary: Google's Material Design Lite with Material Icons and Roboto for Sass powered
|