+
{inputElement}
{elementsInOrder}
diff --git a/src/floating-action-button.jsx b/src/floating-action-button.jsx
index f9feed53518b41..8e4f6f251cb5ea 100644
--- a/src/floating-action-button.jsx
+++ b/src/floating-action-button.jsx
@@ -70,7 +70,7 @@ let FloatingActionButton = React.createClass({
},
_getBackgroundColor() {
- return this.props.disabled ? this.getTheme().disabledColor :
+ return this.props.disabled ? this.getTheme().disabledColor :
this.props.secondary ? this.getTheme().secondaryColor :
this.getTheme().color;
},
@@ -81,7 +81,7 @@ let FloatingActionButton = React.createClass({
},
_getIconColor() {
- return this.props.disabled ? this.getTheme().disabledTextColor :
+ return this.props.disabled ? this.getTheme().disabledTextColor :
this.props.secondary ? this.getTheme().secondaryIconColor :
this.getTheme().iconColor;
},
diff --git a/src/menu/link-menu-item.jsx b/src/menu/link-menu-item.jsx
index 2bee50a4e0e3aa..dfd45a4b540e1e 100644
--- a/src/menu/link-menu-item.jsx
+++ b/src/menu/link-menu-item.jsx
@@ -30,7 +30,7 @@ let LinkMenuItem = React.createClass({
getInitialState() {
return {
hovered: false
- }
+ };
},
getTheme() {
@@ -66,7 +66,7 @@ let LinkMenuItem = React.createClass({
// Prevent context menu 'Open In New Tab/Window'
let linkAttribute = (this.props.disabled) ? 'data-href' : 'href';
let link = {};
- link[linkAttribute] = this.props.payload
+ link[linkAttribute] = this.props.payload;
let styles = this.getStyles();
diff --git a/src/menu/menu.jsx b/src/menu/menu.jsx
index 3cce3726ee040e..2083925073c92c 100644
--- a/src/menu/menu.jsx
+++ b/src/menu/menu.jsx
@@ -10,7 +10,6 @@ let Paper = require('../paper');
let MenuItem = require('./menu-item');
let LinkMenuItem = require('./link-menu-item');
let SubheaderMenuItem = require('./subheader-menu-item');
-let WindowListenable = require('../mixins/window-listenable');
/***********************
@@ -306,7 +305,7 @@ var Menu = React.createClass({
},
_getChildren() {
- let menuItem,
+ let menuItem,
itemComponent,
isDisabled;
@@ -566,7 +565,6 @@ var Menu = React.createClass({
_tryToggleNested(index) {
let item = this.refs[index];
- let toggleMenu = item.toggleNestedMenu;
if (item && item.toggleNestedMenu)
item.toggleNestedMenu();
}
diff --git a/src/menus/icon-menu.jsx b/src/menus/icon-menu.jsx
index cbc10a8528d809..beb4acf784beb6 100644
--- a/src/menus/icon-menu.jsx
+++ b/src/menus/icon-menu.jsx
@@ -1,8 +1,6 @@
let React = require('react/addons');
let ClickAwayable = require('../mixins/click-awayable');
-let Controllable = require('../mixins/controllable');
let StylePropable = require('../mixins/style-propable');
-let Children = require('../utils/children');
let KeyCode = require('../utils/key-code');
let Menu = require('../menus/menu');
@@ -46,7 +44,7 @@ let IconMenu = React.createClass({
return {
iconButtonRef: this.props.iconButtonElement.props.ref || 'iconButton',
open: false
- }
+ };
},
componentClickAway() {
@@ -148,7 +146,7 @@ let IconMenu = React.createClass({
}
},
- _handleIconButtonKeyboardActivate(e) {
+ _handleIconButtonKeyboardActivate() {
this.refs.menu.setKeyboardFocused(true);
},
@@ -161,7 +159,7 @@ let IconMenu = React.createClass({
this.props.onKeyDown(e);
},
- _handleItemKeyboardActivate(e, child) {
+ _handleItemKeyboardActivate() {
//The icon button receives keyboard focus when a
//menu item is keyboard activated
this.refs[this.state.iconButtonRef].setKeyboardFocus();
diff --git a/src/menus/menu.jsx b/src/menus/menu.jsx
index 13786fe7c577b5..ad542c8ee8f99f 100644
--- a/src/menus/menu.jsx
+++ b/src/menus/menu.jsx
@@ -3,8 +3,6 @@ let update = React.addons.update;
let Controllable = require('../mixins/controllable');
let StylePropable = require('../mixins/style-propable');
let Transitions = require('../styles/transitions');
-let Children = require('../utils/children');
-let Dom = require('../utils/dom');
let KeyCode = require('../utils/key-code');
let List = require('../lists/list');
@@ -61,11 +59,11 @@ let Menu = React.createClass({
if (this.props.autoWidth) this._setWidth();
},
- componentDidUpdate(prevProps) {
+ componentDidUpdate() {
if (this.props.autoWidth) this._setWidth();
},
- componentWillUpdate(nextProps, nextState) {
+ componentWillUpdate(nextProps) {
let openChanged = nextProps.open !== this.props.open;
if (openChanged && !nextProps.open) {
this.setState({
diff --git a/src/raised-button.jsx b/src/raised-button.jsx
index 9889a13fa496cb..395c15d49dacec 100644
--- a/src/raised-button.jsx
+++ b/src/raised-button.jsx
@@ -64,7 +64,7 @@ let RaisedButton = React.createClass({
let disabledColor = this.props.disabledBackgroundColor ? this.props.disabledBackgroundColor :
this.getTheme().disabledColor;
- return this.props.disabled ? disabledColor :
+ return this.props.disabled ? disabledColor :
this.props.backgroundColor ? this.props.backgroundColor :
this.props.primary ? this.getTheme().primaryColor :
this.props.secondary ? this.getTheme().secondaryColor :
@@ -75,7 +75,7 @@ let RaisedButton = React.createClass({
let disabledColor = this.props.disabledLabelColor ? this.props.disabledLabelColor :
this.getTheme().disabledTextColor;
- return this.props.disabled ? disabledColor :
+ return this.props.disabled ? disabledColor :
this.props.labelColor ? this.props.labelColor :
this.props.primary ? this.getTheme().primaryTextColor :
this.props.secondary ? this.getTheme().secondaryTextColor :
diff --git a/src/table/table-footer.jsx b/src/table/table-footer.jsx
index cefc453495a955..4d69c06af0a565 100644
--- a/src/table/table-footer.jsx
+++ b/src/table/table-footer.jsx
@@ -65,7 +65,7 @@ let TableFooter = React.createClass({
...props
} = footerData[index];
if (content === undefined) content = footerData[index];
- let key = keyPrefix + index
+ let key = keyPrefix + index;
props.style = (props.style !== undefined) ? this.mergeAndPrefix(props.style, styles.cell) : styles.cell;
footers.push(
diff --git a/src/table/table-header-column.jsx b/src/table/table-header-column.jsx
index c31877266fa698..843dd885fec7e7 100644
--- a/src/table/table-header-column.jsx
+++ b/src/table/table-header-column.jsx
@@ -1,5 +1,4 @@
let React = require('react');
-let Checkbox = require('../checkbox');
let StylePropable = require('../mixins/style-propable');
let Tooltip = require('../tooltip');
diff --git a/src/table/table-header.jsx b/src/table/table-header.jsx
index 113057e969fa9a..4ca204b1afa6ae 100644
--- a/src/table/table-header.jsx
+++ b/src/table/table-header.jsx
@@ -86,7 +86,6 @@ let TableHeader = React.createClass({
},
_getHeaderColumns(headerData, keyPrefix) {
- let styles = this.getStyles();
let headers = [];
for (let index = 0; index < headerData.length; index++) {
diff --git a/src/table/table-row.jsx b/src/table/table-row.jsx
index fe00eeb5a49fda..55a9ce6c6c1940 100644
--- a/src/table/table-row.jsx
+++ b/src/table/table-row.jsx
@@ -2,7 +2,6 @@ let React = require('react');
let Checkbox = require('../checkbox');
let StylePropable = require('../mixins/style-propable');
let TableRowColumn = require('./table-row-column');
-let Tooltip = require('../tooltip');
let TableRow = React.createClass({
diff --git a/src/table/table.jsx b/src/table/table.jsx
index 31cfbd35928579..f1cb6f7027c1a9 100644
--- a/src/table/table.jsx
+++ b/src/table/table.jsx
@@ -4,7 +4,6 @@ let ClickAwayable = require('../mixins/click-awayable');
let TableHeader = require('./table-header');
let TableRow = require('./table-row');
let TableFooter = require('./table-footer');
-let DOM = require('../utils/dom');
let Table = React.createClass({
@@ -273,7 +272,7 @@ let Table = React.createClass({
column.style = {
width: this.props.defaultColumnWidth,
maxWidth: this.props.defaultColumnWidth
- }
+ };
}
else {
if (column.style.width === undefined) column.style.width = this.props.defaultColumnWidth;
@@ -325,7 +324,6 @@ let Table = React.createClass({
if (e.shiftKey && this.props.multiSelectable && selectedRows.length) {
let lastSelection = selectedRows[selectedRows.length - 1];
- let start, end, direction;
if (typeof lastSelection === 'object') {
lastSelection.end = rowNumber;
diff --git a/src/tabs/tabTemplate.jsx b/src/tabs/tabTemplate.jsx
index afbf0f7ed3f4dd..bd531b3aa0f486 100644
--- a/src/tabs/tabTemplate.jsx
+++ b/src/tabs/tabTemplate.jsx
@@ -5,7 +5,7 @@ let TabTemplate = React.createClass({
render() {
let styles = {
- 'height': '0px',
+ 'height': 0,
'overflow': 'hidden',
'width': '100%',
'position': 'relative',
@@ -13,8 +13,8 @@ let TabTemplate = React.createClass({
};
if (this.props.selected) {
- delete styles.height
- delete styles.overflow
+ delete styles.height;
+ delete styles.overflow;
}
return (
diff --git a/src/time-picker/clock-button.jsx b/src/time-picker/clock-button.jsx
index 1fdcd80a3e869d..6ebb92b336a814 100644
--- a/src/time-picker/clock-button.jsx
+++ b/src/time-picker/clock-button.jsx
@@ -25,7 +25,7 @@ let ClockButton = React.createClass({
_handleTouchTap() {
this.setState({
selected: true
- })
+ });
this.props.onTouchTap();
},
@@ -87,8 +87,8 @@ let ClockButton = React.createClass({
disableFocusRipple={true}
disableTouchRipple={true}
onTouchTap={this._handleTouchTap}>
-
-
{this.props.children}
+
+
{this.props.children}
);
}
diff --git a/src/time-picker/clock-hours.jsx b/src/time-picker/clock-hours.jsx
index 9a03592cab9560..07faeacb64b14e 100644
--- a/src/time-picker/clock-hours.jsx
+++ b/src/time-picker/clock-hours.jsx
@@ -5,7 +5,7 @@ let ClockPointer = require("./clock-pointer");
function rad2deg(rad) {
- return rad * 57.29577951308232
+ return rad * 57.29577951308232;
}
function getTouchEventOffsetValues(e) {
@@ -105,7 +105,7 @@ let ClockHours = React.createClass({
let cx = this.basePoint.x - this.center.x;
let cy = this.basePoint.y - this.center.y;
- let atan = Math.atan2(cx, cy) - Math.atan2(x, y);
+ let atan = Math.atan2(cx, cy) - Math.atan2(x, y);
let deg = rad2deg(atan);
deg = Math.round(deg / step ) * step;
@@ -154,7 +154,7 @@ let ClockHours = React.createClass({
return hours.map((hour) => {
let isSelected = this._getSelected() == hour;
- return
;
+ return
;
});
},
diff --git a/src/time-picker/clock-minutes.jsx b/src/time-picker/clock-minutes.jsx
index 21f6f791a73aab..489742dd851277 100644
--- a/src/time-picker/clock-minutes.jsx
+++ b/src/time-picker/clock-minutes.jsx
@@ -5,7 +5,7 @@ let ClockPointer = require("./clock-pointer");
function rad2deg(rad) {
- return rad * 57.29577951308232
+ return rad * 57.29577951308232;
}
function getTouchEventOffsetValues(e) {
@@ -103,7 +103,7 @@ let ClockMinutes = React.createClass({
let cx = this.basePoint.x - this.center.x;
let cy = this.basePoint.y - this.center.y;
- let atan = Math.atan2(cx, cy) - Math.atan2(x, y);
+ let atan = Math.atan2(cx, cy) - Math.atan2(x, y);
let deg = rad2deg(atan);
deg = Math.round(deg / step ) * step;
@@ -157,9 +157,9 @@ let ClockMinutes = React.createClass({
return (
-
+
{minutes.numbers}
-
+
);
}
diff --git a/src/time-picker/clock-number.jsx b/src/time-picker/clock-number.jsx
index 5a9f89153d951b..2954bdc1ce945f 100644
--- a/src/time-picker/clock-number.jsx
+++ b/src/time-picker/clock-number.jsx
@@ -87,7 +87,7 @@ let ClockNumber = React.createClass({
pointerEvents: "none",
boxSizing: "border-box"
}
- }
+ };
if (this.props.isSelected) {
styles.root.backgroundColor = this.getTheme().accentColor;
diff --git a/src/time-picker/clock-pointer.jsx b/src/time-picker/clock-pointer.jsx
index b50b9a3c5583a7..7ee74241bb8a7f 100644
--- a/src/time-picker/clock-pointer.jsx
+++ b/src/time-picker/clock-pointer.jsx
@@ -81,8 +81,8 @@ let ClockPointer = React.createClass({
transform: "rotateZ(" + angle + "deg)"
},
mark: {
- background: this.getTheme().selectTextColor,
- border: "4px solid " + this.getTheme().accentColor,
+ background: this.getTheme().selectTextColor,
+ border: "4px solid " + this.getTheme().accentColor,
width: "7px",
height: "7px",
position: "absolute",
diff --git a/src/time-picker/clock.jsx b/src/time-picker/clock.jsx
index e90f171de2a467..9d9da06665f200 100644
--- a/src/time-picker/clock.jsx
+++ b/src/time-picker/clock.jsx
@@ -20,7 +20,7 @@ let Clock = React.createClass({
init() {
this.setState({
mode: 'hour'
- })
+ });
},
getDefaultProps() {
@@ -46,7 +46,7 @@ let Clock = React.createClass({
setTimeout(() => {
this.setState({
mode: mode
- })
+ });
}, 100);
},
@@ -146,7 +146,7 @@ let Clock = React.createClass({
setTimeout(() => {
this.setState({
mode: 'minute'
- })
+ });
}, 100);
}
},
diff --git a/src/time-picker/time-display.jsx b/src/time-picker/time-display.jsx
index 507412b7481dde..6990b1eace203c 100644
--- a/src/time-picker/time-display.jsx
+++ b/src/time-picker/time-display.jsx
@@ -93,7 +93,7 @@ let TimeDisplay = React.createClass({
hour: {},
minute: {}
- }
+ };
let [hour, min] = this.sanitizeTime();
diff --git a/src/time-picker/time-picker.jsx b/src/time-picker/time-picker.jsx
index da46ce8714e5cf..1df45c88725c24 100644
--- a/src/time-picker/time-picker.jsx
+++ b/src/time-picker/time-picker.jsx
@@ -50,7 +50,7 @@ let TimePicker = React.createClass({
if (this.props.format === "ampm"){
let isAM = hours < 12;
hours = hours % 12;
- aditional += isAM ? " am" : " pm";
+ aditional += isAM ? " am" : " pm";
hours = hours || 12;
}
@@ -60,7 +60,7 @@ let TimePicker = React.createClass({
if (hours.length < 2) hours = "0" + hours;
if (mins.length < 2) mins = "0" + mins;
- return hours + ":" + mins + aditional;
+ return hours + ":" + mins + aditional;
},
render() {
diff --git a/src/toggle.jsx b/src/toggle.jsx
index 25e35abca8afe1..a2bae903eb8739 100644
--- a/src/toggle.jsx
+++ b/src/toggle.jsx
@@ -125,7 +125,7 @@ let Toggle = React.createClass({
left: '-10'
}, this.props.rippleStyle);
- let rippleColor = this.state.switched ?
+ let rippleColor = this.state.switched ?
this.getTheme().thumbOnColor : this.context.muiTheme.component.textColor;
let iconStyle = this.mergeAndPrefix(
diff --git a/src/utils/color-manipulator.js b/src/utils/color-manipulator.js
index 1081d9bf7e882d..fca7cb45104018 100644
--- a/src/utils/color-manipulator.js
+++ b/src/utils/color-manipulator.js
@@ -104,7 +104,7 @@ module.exports = {
if (color.type.indexOf('hsl') > -1) {
color.values[2] += amount;
- return this._decomposeColor(this._convertColorToString(color));
+ return this._decomposeColor(this._convertColorToString(color));
}
else if (color.type.indexOf('rgb') > -1) {
for (let i = 0; i < 3; i++) {
@@ -115,7 +115,7 @@ module.exports = {
if (color.type.indexOf('a') <= -1) color.type += 'a';
- return this._convertColorToString(color, '0.15');
+ return this._convertColorToString(color, '0.15');
},
darken(color, amount) {
@@ -123,7 +123,7 @@ module.exports = {
if (color.type.indexOf('hsl') > -1) {
color.values[2] += amount;
- return this._decomposeColor(this._convertColorToString(color));
+ return this._decomposeColor(this._convertColorToString(color));
}
else if (color.type.indexOf('rgb') > -1) {
for (let i = 0; i < 3; i++) {
From d3d5be5c4de8660659be02fcdf0009db7ddb142a Mon Sep 17 00:00:00 2001
From: Hai Nguyen
Date: Sun, 5 Jul 2015 13:02:41 -0500
Subject: [PATCH 11/16] [Menus] Make menus scrollable by giving a maxHeight
---
.../pages/components/icon-menus.jsx | 75 ++++++++++++++++---
src/lists/list.jsx | 7 +-
src/menus/icon-menu.jsx | 3 +
src/menus/menu.jsx | 42 +++++++----
src/paper.jsx | 8 +-
5 files changed, 106 insertions(+), 29 deletions(-)
diff --git a/docs/src/app/components/pages/components/icon-menus.jsx b/docs/src/app/components/pages/components/icon-menus.jsx
index 076f7c8ea0b9ec..660645fcfb6dad 100644
--- a/docs/src/app/components/pages/components/icon-menus.jsx
+++ b/docs/src/app/components/pages/components/icon-menus.jsx
@@ -219,15 +219,72 @@ class IconMenus extends React.Component {
- }>Preview
- }>Share
- }>Get link
-
- }>Make a copy
- }>Download
-
- }>Remove
-
+ }>Preview
+ }>Share
+ }>Get link
+
+ }>Make a copy
+ }>Download
+
+ }>Remove
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/lists/list.jsx b/src/lists/list.jsx
index dfc85914ba28a7..9fcc3a34d9b8aa 100644
--- a/src/lists/list.jsx
+++ b/src/lists/list.jsx
@@ -15,7 +15,8 @@ let List = React.createClass({
propTypes: {
insetSubheader: React.PropTypes.bool,
subheader: React.PropTypes.string,
- subheaderStyle: React.PropTypes.object
+ subheaderStyle: React.PropTypes.object,
+ zDepth: React.PropTypes.oneOf([0,1,2,3,4,5])
},
getDefaultProps() {
@@ -31,6 +32,7 @@ let List = React.createClass({
style,
subheader,
subheaderStyle,
+ zDepth,
...other
} = this.props;
@@ -60,7 +62,8 @@ let List = React.createClass({
return (
+ style={mergedRootStyles}
+ zDepth={zDepth}>
{subheaderElement}
{this.props.children}
diff --git a/src/menus/icon-menu.jsx b/src/menus/icon-menu.jsx
index beb4acf784beb6..364cb7c6a6baac 100644
--- a/src/menus/icon-menu.jsx
+++ b/src/menus/icon-menu.jsx
@@ -25,6 +25,7 @@ let IconMenu = React.createClass({
]),
onItemKeyboardActivate: React.PropTypes.func,
onItemTouchTap: React.PropTypes.func,
+ maxHeight: React.PropTypes.number,
menuStyle: React.PropTypes.object,
menuListStyle: React.PropTypes.object,
onKeyDown: React.PropTypes.func,
@@ -60,6 +61,7 @@ let IconMenu = React.createClass({
onChange,
onKeyDown,
onItemTouchTap,
+ maxHeight,
menuStyle,
menuListStyle,
style,
@@ -110,6 +112,7 @@ let IconMenu = React.createClass({