nodebb-plugin-composer-default 10.3.15 → 10.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "10.3.15",
3
+ "version": "10.3.17",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -43,12 +43,21 @@ $(document).ready(function () {
43
43
  data.title = data.title || data.topicName;
44
44
  if (config['composer-default'].composeRouteEnabled !== 'on') {
45
45
  require(['composer'], function (composer) {
46
- composer.newReply({
47
- tid: data.tid,
48
- toPid: data.pid,
49
- title: data.title,
50
- body: data.body,
51
- });
46
+ if (data.tid) {
47
+ composer.newReply({
48
+ tid: data.tid,
49
+ toPid: data.pid,
50
+ title: data.title,
51
+ body: data.body,
52
+ });
53
+ } else {
54
+ composer.newTopic({
55
+ cid: data.cid,
56
+ title: data.title || '',
57
+ body: data.body || '',
58
+ tags: data.tags || [],
59
+ });
60
+ }
52
61
  });
53
62
  } else {
54
63
  ajaxify.go(
@@ -135,7 +135,7 @@ define('composer', [
135
135
  bodyEl.val(composer.posts[existingUUID].body);
136
136
  preview.render(postContainer);
137
137
  }
138
- return;
138
+ return composer.load(existingUUID);
139
139
  }
140
140
 
141
141
  var actionText = '[[topic:composer.new-topic]]';