material_design_lite-rails 1.0.1 → 1.0.2

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: 8739ee32c6207fa744cb15331f169ff19b5ea4f1
4
- data.tar.gz: 756253978a0ee1af15b1b620c2c227fe5cdbd361
3
+ metadata.gz: c44cd0f7fb43f678dd22f21baed5285f8c4f7764
4
+ data.tar.gz: 98b72edcbfb300b3547e9d3f77392cb8f353941b
5
5
  SHA512:
6
- metadata.gz: b3f41f39b5d1f8b9ca1ce4c2809f065cf32ea2737b12658e2262e6bfad8f6475e38c4dd52da9c5cf564ba9a0e8d6f8976f02885c24d63885452cb442a8be70ca
7
- data.tar.gz: 35222f293ab3dc0dc120f17bd754d9e05acbae092269f102ac0b48447ffca03f400a8faf1c66a7041201e05a9d419d4fdaaa93049b5a5e16d1e3ec7821017dca
6
+ metadata.gz: 1fd5ff373d6b44c9c621e7f7839e2963540b21520ce10a6d37625c6f2a8c504defe8e63de5f066bf8425a0e646300ad5b3f77c76558c22e6f374c42540109561
7
+ data.tar.gz: f271395db8cf04ce27087a4d4d5b2c4ddfabd437a8fc450a3a5cb7fe29f7aea5d19b9c2cf1f76e6c77217854580bc6a691b66ba119881a43b21e18db94032aaf
@@ -1,5 +1,5 @@
1
1
  module MaterialDesignLite
2
2
  module Rails
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -281,11 +281,11 @@ var componentHandler = (function() {
281
281
  var componentIndex = createdComponents_.indexOf(component);
282
282
  createdComponents_.splice(componentIndex, 1);
283
283
 
284
- var upgrades = component.element_.dataset.upgraded.split(',');
284
+ var upgrades = component.element_.getAttribute('data-upgraded').split(',');
285
285
  var componentPlace = upgrades.indexOf(
286
286
  component[componentConfigProperty_].classAsString);
287
287
  upgrades.splice(componentPlace, 1);
288
- component.element_.dataset.upgraded = upgrades.join(',');
288
+ component.element_.setAttribute('data-upgraded', upgrades.join(','));
289
289
 
290
290
  var ev = document.createEvent('Events');
291
291
  ev.initEvent('mdl-componentdowngraded', true, true);
@@ -633,18 +633,8 @@ MaterialCheckbox.prototype.onMouseUp_ = function(event) {
633
633
  */
634
634
  MaterialCheckbox.prototype.updateClasses_ = function() {
635
635
  'use strict';
636
-
637
- if (this.inputElement_.disabled) {
638
- this.element_.classList.add(this.CssClasses_.IS_DISABLED);
639
- } else {
640
- this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
641
- }
642
-
643
- if (this.inputElement_.checked) {
644
- this.element_.classList.add(this.CssClasses_.IS_CHECKED);
645
- } else {
646
- this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
647
- }
636
+ this.checkDisabled();
637
+ this.checkToggleState();
648
638
  };
649
639
 
650
640
  /**
@@ -663,6 +653,32 @@ MaterialCheckbox.prototype.blur_ = function(event) {
663
653
 
664
654
  // Public methods.
665
655
 
656
+ /**
657
+ * Check the inputs toggle state and update display.
658
+ * @public
659
+ */
660
+ MaterialCheckbox.prototype.checkToggleState = function() {
661
+ 'use strict';
662
+ if (this.inputElement_.checked) {
663
+ this.element_.classList.add(this.CssClasses_.IS_CHECKED);
664
+ } else {
665
+ this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
666
+ }
667
+ };
668
+
669
+ /**
670
+ * Check the inputs disabled state and update display.
671
+ * @public
672
+ */
673
+ MaterialCheckbox.prototype.checkDisabled = function() {
674
+ 'use strict';
675
+ if (this.inputElement_.disabled) {
676
+ this.element_.classList.add(this.CssClasses_.IS_DISABLED);
677
+ } else {
678
+ this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
679
+ }
680
+ };
681
+
666
682
  /**
667
683
  * Disable checkbox.
668
684
  * @public
@@ -895,18 +911,8 @@ MaterialIconToggle.prototype.onMouseUp_ = function(event) {
895
911
  */
896
912
  MaterialIconToggle.prototype.updateClasses_ = function() {
897
913
  'use strict';
898
-
899
- if (this.inputElement_.disabled) {
900
- this.element_.classList.add(this.CssClasses_.IS_DISABLED);
901
- } else {
902
- this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
903
- }
904
-
905
- if (this.inputElement_.checked) {
906
- this.element_.classList.add(this.CssClasses_.IS_CHECKED);
907
- } else {
908
- this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
909
- }
914
+ this.checkDisabled();
915
+ this.checkToggleState();
910
916
  };
911
917
 
912
918
  /**
@@ -925,6 +931,32 @@ MaterialIconToggle.prototype.blur_ = function(event) {
925
931
 
926
932
  // Public methods.
927
933
 
934
+ /**
935
+ * Check the inputs toggle state and update display.
936
+ * @public
937
+ */
938
+ MaterialIconToggle.prototype.checkToggleState = function() {
939
+ 'use strict';
940
+ if (this.inputElement_.checked) {
941
+ this.element_.classList.add(this.CssClasses_.IS_CHECKED);
942
+ } else {
943
+ this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
944
+ }
945
+ };
946
+
947
+ /**
948
+ * Check the inputs disabled state and update display.
949
+ * @public
950
+ */
951
+ MaterialIconToggle.prototype.checkDisabled = function() {
952
+ 'use strict';
953
+ if (this.inputElement_.disabled) {
954
+ this.element_.classList.add(this.CssClasses_.IS_DISABLED);
955
+ } else {
956
+ this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
957
+ }
958
+ };
959
+
928
960
  /**
929
961
  * Disable icon toggle.
930
962
  * @public
@@ -1690,8 +1722,6 @@ MaterialRadio.prototype.CssClasses_ = {
1690
1722
  MaterialRadio.prototype.onChange_ = function(event) {
1691
1723
  'use strict';
1692
1724
 
1693
- this.updateClasses_(this.btnElement_, this.element_);
1694
-
1695
1725
  // Since other radio buttons don't get change events, we need to look for
1696
1726
  // them to update their classes.
1697
1727
  var radios = document.getElementsByClassName(this.CssClasses_.JS_RADIO);
@@ -1699,7 +1729,7 @@ MaterialRadio.prototype.onChange_ = function(event) {
1699
1729
  var button = radios[i].querySelector('.' + this.CssClasses_.RADIO_BTN);
1700
1730
  // Different name == different group, so no point updating those.
1701
1731
  if (button.getAttribute('name') === this.btnElement_.getAttribute('name')) {
1702
- this.updateClasses_(button, radios[i]);
1732
+ radios[i].MaterialRadio.updateClasses_();
1703
1733
  }
1704
1734
  }
1705
1735
  };
@@ -1739,24 +1769,12 @@ MaterialRadio.prototype.onMouseup_ = function(event) {
1739
1769
 
1740
1770
  /**
1741
1771
  * Update classes.
1742
- * @param {HTMLElement} button The button whose classes we should update.
1743
- * @param {HTMLElement} label The label whose classes we should update.
1744
1772
  * @private
1745
1773
  */
1746
- MaterialRadio.prototype.updateClasses_ = function(button, label) {
1774
+ MaterialRadio.prototype.updateClasses_ = function() {
1747
1775
  'use strict';
1748
-
1749
- if (button.disabled) {
1750
- label.classList.add(this.CssClasses_.IS_DISABLED);
1751
- } else {
1752
- label.classList.remove(this.CssClasses_.IS_DISABLED);
1753
- }
1754
-
1755
- if (button.checked) {
1756
- label.classList.add(this.CssClasses_.IS_CHECKED);
1757
- } else {
1758
- label.classList.remove(this.CssClasses_.IS_CHECKED);
1759
- }
1776
+ this.checkDisabled();
1777
+ this.checkToggleState();
1760
1778
  };
1761
1779
 
1762
1780
  /**
@@ -1775,6 +1793,32 @@ MaterialRadio.prototype.blur_ = function(event) {
1775
1793
 
1776
1794
  // Public methods.
1777
1795
 
1796
+ /**
1797
+ * Check the components disabled state.
1798
+ * @public
1799
+ */
1800
+ MaterialRadio.prototype.checkDisabled = function() {
1801
+ 'use strict';
1802
+ if (this.btnElement_.disabled) {
1803
+ this.element_.classList.add(this.CssClasses_.IS_DISABLED);
1804
+ } else {
1805
+ this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
1806
+ }
1807
+ };
1808
+
1809
+ /**
1810
+ * Check the components toggled state.
1811
+ * @public
1812
+ */
1813
+ MaterialRadio.prototype.checkToggleState = function() {
1814
+ 'use strict';
1815
+ if (this.btnElement_.checked) {
1816
+ this.element_.classList.add(this.CssClasses_.IS_CHECKED);
1817
+ } else {
1818
+ this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
1819
+ }
1820
+ };
1821
+
1778
1822
  /**
1779
1823
  * Disable radio.
1780
1824
  * @public
@@ -1783,7 +1827,7 @@ MaterialRadio.prototype.disable = function() {
1783
1827
  'use strict';
1784
1828
 
1785
1829
  this.btnElement_.disabled = true;
1786
- this.updateClasses_(this.btnElement_, this.element_);
1830
+ this.updateClasses_();
1787
1831
  };
1788
1832
 
1789
1833
  /**
@@ -1794,7 +1838,7 @@ MaterialRadio.prototype.enable = function() {
1794
1838
  'use strict';
1795
1839
 
1796
1840
  this.btnElement_.disabled = false;
1797
- this.updateClasses_(this.btnElement_, this.element_);
1841
+ this.updateClasses_();
1798
1842
  };
1799
1843
 
1800
1844
  /**
@@ -1805,7 +1849,7 @@ MaterialRadio.prototype.check = function() {
1805
1849
  'use strict';
1806
1850
 
1807
1851
  this.btnElement_.checked = true;
1808
- this.updateClasses_(this.btnElement_, this.element_);
1852
+ this.updateClasses_();
1809
1853
  };
1810
1854
 
1811
1855
  /**
@@ -1816,7 +1860,7 @@ MaterialRadio.prototype.uncheck = function() {
1816
1860
  'use strict';
1817
1861
 
1818
1862
  this.btnElement_.checked = false;
1819
- this.updateClasses_(this.btnElement_, this.element_);
1863
+ this.updateClasses_();
1820
1864
  };
1821
1865
 
1822
1866
  /**
@@ -1862,7 +1906,7 @@ MaterialRadio.prototype.init = function() {
1862
1906
  this.btnElement_.addEventListener('blur', this.onBlur_.bind(this));
1863
1907
  this.element_.addEventListener('mouseup', this.onMouseup_.bind(this));
1864
1908
 
1865
- this.updateClasses_(this.btnElement_, this.element_);
1909
+ this.updateClasses_();
1866
1910
  this.element_.classList.add(this.CssClasses_.IS_UPGRADED);
1867
1911
  }
1868
1912
  };
@@ -2379,24 +2423,12 @@ MaterialSwitch.prototype.onMouseUp_ = function(event) {
2379
2423
 
2380
2424
  /**
2381
2425
  * Handle class updates.
2382
- * @param {HTMLElement} button The button whose classes we should update.
2383
- * @param {HTMLElement} label The label whose classes we should update.
2384
2426
  * @private
2385
2427
  */
2386
2428
  MaterialSwitch.prototype.updateClasses_ = function() {
2387
2429
  'use strict';
2388
-
2389
- if (this.inputElement_.disabled) {
2390
- this.element_.classList.add(this.CssClasses_.IS_DISABLED);
2391
- } else {
2392
- this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
2393
- }
2394
-
2395
- if (this.inputElement_.checked) {
2396
- this.element_.classList.add(this.CssClasses_.IS_CHECKED);
2397
- } else {
2398
- this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
2399
- }
2430
+ this.checkDisabled();
2431
+ this.checkToggleState();
2400
2432
  };
2401
2433
 
2402
2434
  /**
@@ -2415,6 +2447,32 @@ MaterialSwitch.prototype.blur_ = function(event) {
2415
2447
 
2416
2448
  // Public methods.
2417
2449
 
2450
+ /**
2451
+ * Check the components disabled state.
2452
+ * @public
2453
+ */
2454
+ MaterialSwitch.prototype.checkDisabled = function() {
2455
+ 'use strict';
2456
+ if (this.inputElement_.disabled) {
2457
+ this.element_.classList.add(this.CssClasses_.IS_DISABLED);
2458
+ } else {
2459
+ this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
2460
+ }
2461
+ };
2462
+
2463
+ /**
2464
+ * Check the components toggled state.
2465
+ * @public
2466
+ */
2467
+ MaterialSwitch.prototype.checkToggleState = function() {
2468
+ 'use strict';
2469
+ if (this.inputElement_.checked) {
2470
+ this.element_.classList.add(this.CssClasses_.IS_CHECKED);
2471
+ } else {
2472
+ this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
2473
+ }
2474
+ };
2475
+
2418
2476
  /**
2419
2477
  * Disable switch.
2420
2478
  * @public
@@ -3126,7 +3184,7 @@ function MaterialLayout(element) {
3126
3184
  * @private
3127
3185
  */
3128
3186
  MaterialLayout.prototype.Constant_ = {
3129
- MAX_WIDTH: '(max-width: 850px)',
3187
+ MAX_WIDTH: '(max-width: 1024px)',
3130
3188
  TAB_SCROLL_PIXELS: 100,
3131
3189
 
3132
3190
  MENU_ICON: 'menu',
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * material-design-lite - Material Design Components in CSS, JS and HTML
3
- * @version v1.0.1
3
+ * @version v1.0.2
4
4
  * @license Apache-2.0
5
5
  * @copyright 2015 Google, Inc.
6
6
  * @link https://github.com/google/material-design-lite
@@ -6454,6 +6454,8 @@ input.mdl-button[type="submit"] {
6454
6454
  .mdl-layout--fixed-drawer:not(.is-small-screen) > .mdl-layout__header {
6455
6455
  margin-left: 240px;
6456
6456
  width: calc(100% - 240px); }
6457
+ .mdl-layout--fixed-drawer > .mdl-layout__header .mdl-layout__header-row {
6458
+ padding-left: 40px; }
6457
6459
  .mdl-layout__header > .mdl-layout-icon {
6458
6460
  position: absolute;
6459
6461
  left: 40px;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material_design_lite-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Collins