material_design_lite-rails 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 933d0eec98e2344efbe143127ad415f2f51730cc
4
- data.tar.gz: 9324a1215e4fa866a2295f3d70f890cad93a3add
3
+ metadata.gz: c5035a7efea133caaa8f50a46937b7a9e3e5cc23
4
+ data.tar.gz: 2b4a6e2c0f63f4dcf8a6849d511a5341cfdd928e
5
5
  SHA512:
6
- metadata.gz: 8069f9413afa682daba19ae6d7657b9aa5802f3425a735abb427a37049ddd962ffe695f09bf769a71af6fa97aaa8536a62e979b46a9c4636809cbd95adeb0aa3
7
- data.tar.gz: cd570df80a15f4a8ab074259f341da87bbae8590690db6842af1064bd2a9f44136c3c672945a8a4d661132727079aff48c6f656a0263de7e437131505823fcac
6
+ metadata.gz: 4bbe41c8e477d884d73c872003a147da4c1758538cacd43eea64e0a6fdcb3f85d46b43600fe17f962bab19e892c24d50f5e201d93b2929d880393a025f169db2
7
+ data.tar.gz: 4a05d67ec55f3d155597c15f67be078ba9de19434838d5bc1af7baf3ee3cd66ee8cd2584535742e93621cc49dad169d9b7ab15543b06b701a83cba696aafa9e1
@@ -1,5 +1,5 @@
1
1
  module MaterialDesignLite
2
2
  module Rails
3
- VERSION = "1.2.1"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  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 ev;
234
- if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {
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
- * Date.now polyfill.
506
- * @return {number} the current Date
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
- * requestAnimationFrame polyfill.
528
- * @param {!Function} callback the callback function.
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'].updateClasses_();
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
- e.preventDefault();
2721
- var href = tab.href.split('#')[1];
2722
- var panel = ctx.element_.querySelector('#' + href);
2723
- ctx.resetTabState_();
2724
- ctx.resetPanelState_();
2725
- tab.classList.add(ctx.CssClasses_.ACTIVE_CLASS);
2726
- panel.classList.add(ctx.CssClasses_.ACTIVE_CLASS);
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
- tab.addEventListener('click', function (e) {
3579
- if (tab.getAttribute('href').charAt(0) === '#') {
3580
- e.preventDefault();
3581
- selectTab();
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
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * material-design-lite - Material Design Components in CSS, JS and HTML
3
- * @version v1.2.1
3
+ * @version v1.3.0
4
4
  * @license Apache-2.0
5
5
  * @copyright 2015 Google, Inc.
6
6
  * @link https://github.com/google/material-design-lite
@@ -4275,6 +4275,8 @@ input.mdl-button[type="submit"] {
4275
4275
  overflow: hidden;
4276
4276
  padding: 16px 16px;
4277
4277
  width: 90%; }
4278
+ .mdl-card__supporting-text.mdl-card--border {
4279
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
4278
4280
 
4279
4281
  .mdl-card__actions {
4280
4282
  font-size: 16px;
@@ -7471,7 +7473,6 @@ input.mdl-button[type="submit"] {
7471
7473
  flex-direction: column;
7472
7474
  -webkit-align-items: stretch;
7473
7475
  -ms-flex-align: stretch;
7474
- -ms-grid-row-align: stretch;
7475
7476
  align-items: stretch;
7476
7477
  padding-top: 16px; }
7477
7478
  .mdl-layout__drawer .mdl-navigation .mdl-navigation__link {
@@ -7675,7 +7676,6 @@ input.mdl-button[type="submit"] {
7675
7676
  flex-direction: row;
7676
7677
  -webkit-align-items: center;
7677
7678
  -ms-flex-align: center;
7678
- -ms-grid-row-align: center;
7679
7679
  align-items: center; }
7680
7680
  @media screen and (max-width: 1024px) {
7681
7681
  .mdl-layout__header-row .mdl-navigation {
@@ -8083,7 +8083,9 @@ input.mdl-button[type="submit"] {
8083
8083
  font-size: 16px;
8084
8084
  line-height: 24px;
8085
8085
  display: inline-block;
8086
+ vertical-align: middle;
8086
8087
  box-sizing: border-box;
8088
+ height: 24px;
8087
8089
  margin: 0;
8088
8090
  padding-left: 0; }
8089
8091
  .mdl-radio.is-upgraded {
@@ -8139,13 +8141,13 @@ input.mdl-button[type="submit"] {
8139
8141
  transition-property: -webkit-transform;
8140
8142
  transition-property: transform;
8141
8143
  transition-property: transform, -webkit-transform;
8142
- -webkit-transform: scale3d(0, 0, 0);
8143
- transform: scale3d(0, 0, 0);
8144
+ -webkit-transform: scale(0, 0);
8145
+ transform: scale(0, 0);
8144
8146
  border-radius: 50%;
8145
8147
  background: rgb(63,81,181); }
8146
8148
  .mdl-radio.is-checked .mdl-radio__inner-circle {
8147
- -webkit-transform: scale3d(1, 1, 1);
8148
- transform: scale3d(1, 1, 1); }
8149
+ -webkit-transform: scale(1, 1);
8150
+ transform: scale(1, 1); }
8149
8151
  fieldset[disabled] .mdl-radio .mdl-radio__inner-circle,
8150
8152
  .mdl-radio.is-disabled .mdl-radio__inner-circle {
8151
8153
  background: rgba(0,0,0, 0.26);
@@ -8372,6 +8374,7 @@ _:-ms-input-placeholder, :root .mdl-slider.mdl-slider.is-upgraded {
8372
8374
  color: rgb(63,81,181);
8373
8375
  -webkit-align-self: center;
8374
8376
  -ms-flex-item-align: center;
8377
+ -ms-grid-row-align: center;
8375
8378
  align-self: center;
8376
8379
  z-index: 1;
8377
8380
  cursor: pointer;
@@ -8842,6 +8845,7 @@ _:-ms-input-placeholder, :root .mdl-slider.mdl-slider.is-upgraded {
8842
8845
  text-align: center;
8843
8846
  -webkit-align-self: center;
8844
8847
  -ms-flex-item-align: center;
8848
+ -ms-grid-row-align: center;
8845
8849
  align-self: center; }
8846
8850
  .mdl-snackbar__action::-moz-focus-inner {
8847
8851
  border: 0; }
@@ -9264,6 +9268,10 @@ _:-ms-input-placeholder, :root .mdl-slider.mdl-slider.is-upgraded {
9264
9268
  height: 100%;
9265
9269
  overflow: hidden;
9266
9270
  border-color: inherit; }
9271
+ .mdl-spinner__circle-clipper.mdl-spinner__left {
9272
+ float: left; }
9273
+ .mdl-spinner__circle-clipper.mdl-spinner__right {
9274
+ float: right; }
9267
9275
  .mdl-spinner__circle-clipper .mdl-spinner__circle {
9268
9276
  width: 200%; }
9269
9277
 
@@ -10871,6 +10879,7 @@ _:-ms-input-placeholder, :root .mdl-slider.mdl-slider.is-upgraded {
10871
10879
  .mdl-cell--middle {
10872
10880
  -webkit-align-self: center;
10873
10881
  -ms-flex-item-align: center;
10882
+ -ms-grid-row-align: center;
10874
10883
  align-self: center; }
10875
10884
 
10876
10885
  .mdl-cell--bottom {
@@ -10881,6 +10890,7 @@ _:-ms-input-placeholder, :root .mdl-slider.mdl-slider.is-upgraded {
10881
10890
  .mdl-cell--stretch {
10882
10891
  -webkit-align-self: stretch;
10883
10892
  -ms-flex-item-align: stretch;
10893
+ -ms-grid-row-align: stretch;
10884
10894
  align-self: stretch; }
10885
10895
 
10886
10896
  .mdl-grid.mdl-grid--no-spacing > .mdl-cell {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material_design_lite-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Collins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2016-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties