Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Presave functionality, 1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Oct 19, 2018
1 parent dd9d48c commit d14798d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
7 changes: 5 additions & 2 deletions app/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ export default class Home extends React.Component {
var text = this.updatePreviewText();
if(this.note) {
this.note.content.text = text;
this.note.content.preview_plain = this.truncateString(this.preview.textContent || this.preview.innerText);
this.componentManager.saveItem(this.note);
let presave = () => {
this.note.content.preview_plain = this.truncateString(this.preview.textContent || this.preview.innerText);
this.note.content.preview_html = null;
}
this.componentManager.saveItemWithPresave(this.note, presave);
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion dist/dist.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sn-simple-markdown-editor",
"version": "1.1.7",
"version": "1.1.9",
"main": "dist/dist.js",
"scripts": {
"lint": "eslint --cache --ignore-path .gitignore --ext .jsx,.js --format=node_modules/eslint-formatter-pretty .",
Expand Down Expand Up @@ -46,7 +46,7 @@
"react": "15.x",
"react-dom": "15.x",
"sass-loader": "^6.0.6",
"sn-components-api": "1.1.5",
"sn-components-api": "1.1.9",
"sortablejs": "^1.7.0",
"style-loader": "~0.13.1",
"validate-commit-msg": "2.x",
Expand Down

0 comments on commit d14798d

Please sign in to comment.