Skip to content

Commit

Permalink
refactor (comments): new dynamic comments approach
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Oct 27, 2021
1 parent ecf67e4 commit d3aeea1
Show file tree
Hide file tree
Showing 51 changed files with 8,260 additions and 7,900 deletions.
2 changes: 1 addition & 1 deletion src/adonisjs/public/author/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<script src="/author/js/comments.js"></script>
<script src="/author/js/artifacts.js"></script>
<script src="/author/js/generator/artifact-knot.js"></script>
<script src="/author/js/editor.js"></script>
<script src="/author/js/modifier.js"></script>

<script src="/author/js/author.js"></script>
</head>
Expand Down
10 changes: 7 additions & 3 deletions src/adonisjs/public/author/js/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,19 +539,23 @@ class AuthorManager {
this._renderKnot()
delete this._elementSelected
await this._updateActiveComments()
this._comments = new Comments(this._compiledCase, knotid)
Comments.prepare(this._compiledCase, knotid)
if (Panels.s.commentsVisible)
this._comments.activateComments()
MessageBus.i.publish('control/comments/editor')
MessageBus.i.publish('control/case/ready', null, true)
}
}

async _updateActiveComments() {
if (Comments.i && Comments.i.activated)
await MessageBus.i.request('control/comments/submit', null, null, true)
/*
if (this._comments != null) {
if (this._comments.activated)
await MessageBus.i.request('control/comments/submit', null, null, true)
this._comments.close()
}
*/
}

/*
Expand Down Expand Up @@ -637,7 +641,7 @@ class AuthorManager {
(message != null && message.knotid != null)
? message.knotid : this._knotSelected

let status = await MessageBus.i.request('edit/knot/create',
let status = await MessageBus.i.request('modify/knot/create',
{target: knotTarget,
before: false,
template: template})
Expand Down
Loading

0 comments on commit d3aeea1

Please sign in to comment.