Skip to content

Commit

Permalink
random uid
Browse files Browse the repository at this point in the history
update dependencies
  • Loading branch information
i-kitaev committed Dec 15, 2016
1 parent b25a5a1 commit 0c39bb0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "react-summernote",
"version": "1.0.4",
"version": "1.0.5",
"description": "Summernote (Super simple WYSIWYG editor) adaptation for react",
"main": "./dist/react-summernote.js",
"repository": {
"type": "git",
"url": "https://github.com/Vnkitaev/react-summernote.git"
},
"scripts": {
"compile": "webpack --config ./webpack.config.js"
"build": "webpack --config ./webpack.config.js"
},
"keywords": [
"summernote",
Expand Down Expand Up @@ -39,20 +39,20 @@
"react-dom": "*"
},
"devDependencies": {
"webpack": "1.13.3",
"babel-core": "6.18.2",
"babel-loader": "6.2.7",
"webpack": "1.14.0",
"babel-core": "6.20.0",
"babel-loader": "6.2.10",
"babel-preset-es2015": "6.18.0",
"babel-preset-react": "6.16.0",
"url-loader": "0.5.7",
"file-loader": "0.9.0",
"style-loader": "0.13.1",
"css-loader": "0.25.0",
"css-loader": "0.26.1",
"extract-text-webpack-plugin": "1.0.1",
"copy-webpack-plugin": "4.0.0",
"eslint": "3.10.0",
"copy-webpack-plugin": "4.0.1",
"eslint": "3.12.2",
"eslint-config-airbnb": "13.0.0",
"eslint-plugin-react": "6.6.0",
"eslint-plugin-react": "6.8.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "2.2.3"
}
Expand Down
9 changes: 7 additions & 2 deletions src/Summernote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'summernote/dist/summernote.css';
import 'codemirror/lib/codemirror.css';
import React, { Component, PropTypes } from 'react';

const randomUid = () => Math.floor(Math.random() * 1000);

class ReactSummernote extends Component {
static reset() {
this.editor.summernote('reset');
Expand All @@ -25,7 +27,7 @@ class ReactSummernote extends Component {
constructor(props) {
super(props);

this.uid = `react-summernote-${Date.now()}`;
this.uid = `react-summernote-${randomUid()}`;
this.editor = {};

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

componentWillUnmount() {
if (this.editor) this.editor.summernote('destroy');
if (this.editor) {
this.editor.summernote('destroy');
}

this.manageModalScroll(false);
}

Expand Down

0 comments on commit 0c39bb0

Please sign in to comment.