Skip to content

Commit 0c39bb0

Browse files
committed
random uid
update dependencies
1 parent b25a5a1 commit 0c39bb0

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "react-summernote",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "Summernote (Super simple WYSIWYG editor) adaptation for react",
55
"main": "./dist/react-summernote.js",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/Vnkitaev/react-summernote.git"
99
},
1010
"scripts": {
11-
"compile": "webpack --config ./webpack.config.js"
11+
"build": "webpack --config ./webpack.config.js"
1212
},
1313
"keywords": [
1414
"summernote",
@@ -39,20 +39,20 @@
3939
"react-dom": "*"
4040
},
4141
"devDependencies": {
42-
"webpack": "1.13.3",
43-
"babel-core": "6.18.2",
44-
"babel-loader": "6.2.7",
42+
"webpack": "1.14.0",
43+
"babel-core": "6.20.0",
44+
"babel-loader": "6.2.10",
4545
"babel-preset-es2015": "6.18.0",
4646
"babel-preset-react": "6.16.0",
4747
"url-loader": "0.5.7",
4848
"file-loader": "0.9.0",
4949
"style-loader": "0.13.1",
50-
"css-loader": "0.25.0",
50+
"css-loader": "0.26.1",
5151
"extract-text-webpack-plugin": "1.0.1",
52-
"copy-webpack-plugin": "4.0.0",
53-
"eslint": "3.10.0",
52+
"copy-webpack-plugin": "4.0.1",
53+
"eslint": "3.12.2",
5454
"eslint-config-airbnb": "13.0.0",
55-
"eslint-plugin-react": "6.6.0",
55+
"eslint-plugin-react": "6.8.0",
5656
"eslint-plugin-import": "2.2.0",
5757
"eslint-plugin-jsx-a11y": "2.2.3"
5858
}

src/Summernote.jsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import 'summernote/dist/summernote.css';
55
import 'codemirror/lib/codemirror.css';
66
import React, { Component, PropTypes } from 'react';
77

8+
const randomUid = () => Math.floor(Math.random() * 1000);
9+
810
class ReactSummernote extends Component {
911
static reset() {
1012
this.editor.summernote('reset');
@@ -25,7 +27,7 @@ class ReactSummernote extends Component {
2527
constructor(props) {
2628
super(props);
2729

28-
this.uid = `react-summernote-${Date.now()}`;
30+
this.uid = `react-summernote-${randomUid()}`;
2931
this.editor = {};
3032

3133
ReactSummernote.reset = ReactSummernote.reset.bind(this);
@@ -48,7 +50,10 @@ class ReactSummernote extends Component {
4850
}
4951

5052
componentWillUnmount() {
51-
if (this.editor) this.editor.summernote('destroy');
53+
if (this.editor) {
54+
this.editor.summernote('destroy');
55+
}
56+
5257
this.manageModalScroll(false);
5358
}
5459

0 commit comments

Comments
 (0)