1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

Added dialog-polyfill.

closes #23
This commit is contained in:
ivaosthu 2016-12-22 14:09:16 +01:00
parent 8d84ec04c2
commit c9ea64639e
3 changed files with 13 additions and 1 deletions

View File

@ -31,6 +31,7 @@
"main": "./index.js",
"dependencies": {
"debug": "^2.2.0",
"dialog-polyfill": "^0.4.5",
"immutability-helper": "^2.0.0",
"immutable": "^3.8.1",
"normalize.css": "^5.0.0",

View File

@ -1,5 +1,6 @@
import React, { PropTypes } from 'react';
import { Textfield, Dialog, DialogTitle, DialogContent, DialogActions, Button } from 'react-mdl';
import dialogPolyfill from 'dialog-polyfill/dialog-polyfill.js';
class EditUserComponent extends React.Component {
static propTypes () {
@ -10,11 +11,20 @@ class EditUserComponent extends React.Component {
};
}
componentDidMount () {
this.initPolyfill();
}
handleSubmit = (evt) => {
evt.preventDefault();
this.props.save();
}
initPolyfill () {
const dialogs = document.querySelectorAll('dialog');
[].slice.call(dialogs).forEach(dialog => dialogPolyfill.registerDialog(dialog));
}
render () {
return (
<div>

View File

@ -1,6 +1,7 @@
import 'dialog-polyfill/dialog-polyfill.css';
import 'whatwg-fetch';
import 'react-mdl/extra/material.css';
import 'react-mdl/extra/material.js';
import 'whatwg-fetch';
import React from 'react';
import ReactDOM from 'react-dom';