Skip to content

Commit

Permalink
Merge pull request #500 from grmlin/patch-1
Browse files Browse the repository at this point in the history
overwriting props will create console warnings. Fixes #547
  • Loading branch information
mmrtnz committed Apr 17, 2015
2 parents c6967d1 + 93ce4ba commit dab5b46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/dialog-window.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ var DialogWindow = React.createClass({

_addClassName: function(reactObject, className) {
var originalClassName = reactObject.props.className;
var newClassname = originalClassName ? originalClassName + ' ' + className : className;

reactObject.props.className = originalClassName ?
originalClassName + ' ' + className : className;
return React.cloneElement(reactObject, { className: newClassname });
},

_getAction: function(actionJSON, key) {
Expand All @@ -118,14 +118,14 @@ var DialogWindow = React.createClass({

if (actions.length) {
for (var i = 0; i < actions.length; i++) {
currentAction = actions[i];
var currentAction = actions[i];

//if the current action isn't a react object, create one
if (!React.isValidElement(currentAction)) {
currentAction = this._getAction(currentAction, i);
}

this._addClassName(currentAction, 'mui-dialog-window-action');
currentAction = this._addClassName(currentAction, 'mui-dialog-window-action');
actionObjects.push(currentAction);
};

Expand Down

0 comments on commit dab5b46

Please sign in to comment.