Skip to content

Commit

Permalink
blogifierdotnet#267 - Editor part 4
Browse files Browse the repository at this point in the history
  • Loading branch information
farzindev committed Apr 6, 2021
1 parent d9beb60 commit 46a220c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@

protected bool _hideGraph = false;
protected bool _hideList = true;
string _checkedGraph = "checked";
string _checkedList = "";
// string _checkedGraph = "checked";
// string _checkedList = "";
protected override async Task OnInitializedAsync()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Blogifier.Admin/Pages/Blog/Editor.razor
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</div>
<div class="editor-wrap">
<div class="editor-header">
<img class="editor-cover" src="/@Post.Cover" alt="Cover" id="post-cover">
<img class="editor-cover" src="@Post.Cover" alt="Cover" id="post-cover">

<div class="editor-header-inner">

Expand Down Expand Up @@ -139,7 +139,7 @@
Post.Content = await _jsruntime.InvokeAsync<string>("commonJsFunctions.getEditorValue", "");
Post.PostType = _stateprovider.PostType;

Post.Cover = await _jsruntime.InvokeAsync<string>("commonJsFunctions.getTxtValue", "post-cover");
Post.Cover = await _jsruntime.InvokeAsync<string>("commonJsFunctions.getSrcValue", "post-cover");

if(string.IsNullOrEmpty(Post.Cover))
Post.Cover = Constants.DefaultCover;
Expand Down
4 changes: 2 additions & 2 deletions src/Blogifier.Admin/Pages/Pages/Editor.razor
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</div>
<div class="editor-wrap">
<div class="editor-header">
<img class="editor-cover" src="/@Post.Cover" alt="Cover" id="post-cover">
<img class="editor-cover" src="@Post.Cover" alt="Cover" id="post-cover">
<div class="editor-header-inner">
<textarea class="editor-header-textarea editor-header-title autosize" @bind="Post.Title" name="title" placeholder="@_localizer["page-title"]" rows="1" autofocus></textarea>
<textarea class="editor-header-textarea editor-header-desc autosize" @bind="Post.Description" name="description" placeholder="@_localizer["description"]..." rows="1"></textarea>
Expand Down Expand Up @@ -119,7 +119,7 @@
Post.Content = await _jsruntime.InvokeAsync<string>("commonJsFunctions.getEditorValue", "");
Post.PostType = PostType.Page;

Post.Cover = await _jsruntime.InvokeAsync<string>("commonJsFunctions.getTxtValue", "post-cover");
Post.Cover = await _jsruntime.InvokeAsync<string>("commonJsFunctions.getSrcValue", "post-cover");
if(string.IsNullOrEmpty(Post.Cover))
Post.Cover = Constants.DefaultCover;

Expand Down
5 changes: 4 additions & 1 deletion src/Blogifier.Admin/wwwroot/admin/js/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ window.commonJsFunctions = {
}
},
getTxtValue: function (txt) {
return document.getElementById(txt).value;
return document.getElementById(txt).value;
},
getSrcValue: function (src) {
return document.getElementById(src).src;
},
focusElement: function (id) {
setTimeout(function () {
Expand Down

0 comments on commit 46a220c

Please sign in to comment.