Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ bld/
/src/DotNetBlog.Admin/node_modules
/src/DotNetBlog.Admin/**/*.js.map
/src/DotNetBlog.Web/wwwroot/app/**/*.js.map
/src/DotNetBlog.Web/wwwroot/dist
/src/DotNetBlog.Web/wwwroot/upload
/src/DotNetBlog.Web/wwwroot/app/dist
!/src/DotNetBlog.Web/wwwroot/app/webpack.config.js
Expand Down
12 changes: 5 additions & 7 deletions DotNetBlog.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.3
# Visual Studio Version 16
VisualStudioVersion = 16.0.30309.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9728357A-237B-4337-A648-6F56FE479A6F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{61946056-1D5C-4774-B0D8-8FABADBDBE81}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetBlog.Web", "src\DotNetBlog.Web\DotNetBlog.Web.csproj", "{89F9B8C8-2F34-41CF-B39E-C23935AFADC8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetBlog.Core", "src\DotNetBlog.Core\DotNetBlog.Core.csproj", "{89065586-C5EF-4EF4-BCD5-63D47E6E3816}"
Expand Down Expand Up @@ -62,4 +57,7 @@ Global
{89065586-C5EF-4EF4-BCD5-63D47E6E3816} = {9728357A-237B-4337-A648-6F56FE479A6F}
{D2657CFC-8E57-49BB-9BE9-4FE37599F0E3} = {9728357A-237B-4337-A648-6F56FE479A6F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A8BDBED8-2603-4771-8572-3EBAA91BF2E5}
EndGlobalSection
EndGlobal
11 changes: 0 additions & 11 deletions Nuget.config

This file was deleted.

4 changes: 0 additions & 4 deletions global.json

This file was deleted.

15 changes: 8 additions & 7 deletions src/DotNetBlog.Admin/components/editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ class Editor extends React.Component{
}
},
this.props.options);
this.editor = editormd(this.id, options);
var currentEditor = this.editor = editormd(this.id, options);
var lang = "editorLang".L();

if (lang != "zh-cn") {
editormd.loadScript("lib/editor.md/languages/" + lang, function () {
this.editor.lang = editormd.defaults.lang;
this.editor.recreate();
currentEditor.lang = editormd.defaults.lang;
});
}
}
Expand All @@ -49,14 +49,15 @@ class Editor extends React.Component{
return this.editor.markdownTextarea.val();
}

setContent(content){
this.editor.markdownTextarea.val(content)
setContent(content) {
this.editor.markdownTextarea.val(content);
this.editor.recreate();
}

componentDidUpdate(prevProps){
if(prevProps.content != this.props.content){
if(this.editor){
this.editor.markdownTextarea.val(this.props.content)
if (this.editor) {
this.setContent(this.props.content)
}
}
}
Expand Down
Loading