nodebb-plugin-composer-default 7.0.19 → 7.0.22
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
|
@@ -42,12 +42,14 @@ define('composer/autocomplete', ['composer/preview'], function (preview) {
|
|
|
42
42
|
clearTimeout(timer);
|
|
43
43
|
timer = setTimeout(function () {
|
|
44
44
|
var dropdown = document.querySelector('.' + dropdownClass);
|
|
45
|
-
|
|
45
|
+
if (dropdown) {
|
|
46
|
+
var pos = dropdown.getBoundingClientRect();
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
var margin = parseFloat(dropdown.style.marginTop, 10) || 0;
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
var offset = window.innerHeight + margin - 10 - pos.bottom;
|
|
51
|
+
dropdown.style.marginTop = Math.min(offset, 0) + 'px';
|
|
52
|
+
}
|
|
51
53
|
}, 0);
|
|
52
54
|
});
|
|
53
55
|
|
|
@@ -17,6 +17,7 @@ define('composer/formatting', ['composer/preview', 'composer/resize', 'topicThum
|
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
thumbs: function () {
|
|
20
|
+
formatting.exitFullscreen();
|
|
20
21
|
var postContainer = this;
|
|
21
22
|
require(['composer'], function (composer) {
|
|
22
23
|
const uuid = postContainer.get(0).getAttribute('data-uuid');
|
|
@@ -61,11 +62,18 @@ define('composer/formatting', ['composer/preview', 'composer/resize', 'topicThum
|
|
|
61
62
|
});
|
|
62
63
|
|
|
63
64
|
screenfull.toggle(postContainer.get(0));
|
|
65
|
+
$(window).trigger('action:composer.fullscreen', { postContainer: postContainer });
|
|
64
66
|
},
|
|
65
67
|
};
|
|
66
68
|
|
|
67
69
|
var buttons = [];
|
|
68
70
|
|
|
71
|
+
formatting.exitFullscreen = function () {
|
|
72
|
+
if (screenfull.isEnabled && screenfull.isFullscreen) {
|
|
73
|
+
screenfull.exit();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
69
77
|
formatting.addComposerButtons = function () {
|
|
70
78
|
for (var x = 0, numButtons = buttons.length; x < numButtons; x++) {
|
|
71
79
|
$('.formatting-bar .formatting-group #fileForm').before('<li tabindex="-1" data-format="' + buttons[x].name + '" title="' + (buttons[x].title || '') + '"><i class="' + buttons[x].iconClass + '"></i></li>');
|
package/static/lib/composer.js
CHANGED
|
@@ -24,8 +24,7 @@ define('composer', [
|
|
|
24
24
|
'search',
|
|
25
25
|
], function (taskbar, translator, uploads, formatting, drafts, tags,
|
|
26
26
|
categoryList, preview, resize, autocomplete, scheduler, scrollStop,
|
|
27
|
-
topicThumbs, api, bootbox, alerts, hooks, messagesModule, search
|
|
28
|
-
) {
|
|
27
|
+
topicThumbs, api, bootbox, alerts, hooks, messagesModule, search) {
|
|
29
28
|
var composer = {
|
|
30
29
|
active: undefined,
|
|
31
30
|
posts: {},
|
|
@@ -175,7 +174,7 @@ define('composer', [
|
|
|
175
174
|
if (showAlert) {
|
|
176
175
|
alerts.alert({
|
|
177
176
|
type: 'danger',
|
|
178
|
-
timeout:
|
|
177
|
+
timeout: 10000,
|
|
179
178
|
title: '',
|
|
180
179
|
message: message,
|
|
181
180
|
alert_id: 'post_error',
|
|
@@ -198,7 +197,7 @@ define('composer', [
|
|
|
198
197
|
formatting.addButton(iconClass, onClick, title);
|
|
199
198
|
};
|
|
200
199
|
|
|
201
|
-
composer.newTopic =
|
|
200
|
+
composer.newTopic = async (data) => {
|
|
202
201
|
var pushData = {
|
|
203
202
|
action: 'topics.post',
|
|
204
203
|
cid: data.cid,
|
|
@@ -209,10 +208,10 @@ define('composer', [
|
|
|
209
208
|
isMain: true,
|
|
210
209
|
};
|
|
211
210
|
|
|
212
|
-
|
|
211
|
+
({ pushData } = await hooks.fire('filter:composer.topic.push', {
|
|
213
212
|
data: data,
|
|
214
213
|
pushData: pushData,
|
|
215
|
-
});
|
|
214
|
+
}));
|
|
216
215
|
|
|
217
216
|
push(pushData);
|
|
218
217
|
};
|
|
@@ -367,10 +366,7 @@ define('composer', [
|
|
|
367
366
|
return removeComposerHistory();
|
|
368
367
|
}
|
|
369
368
|
|
|
370
|
-
|
|
371
|
-
if (screenfull.isEnabled && screenfull.isFullscreen) {
|
|
372
|
-
screenfull.exit();
|
|
373
|
-
}
|
|
369
|
+
formatting.exitFullscreen();
|
|
374
370
|
|
|
375
371
|
var btn = $(this).prop('disabled', true);
|
|
376
372
|
translator.translate('[[modules:composer.discard]]', function (translated) {
|
|
@@ -797,7 +793,7 @@ define('composer', [
|
|
|
797
793
|
removeComposerHistory();
|
|
798
794
|
}
|
|
799
795
|
|
|
800
|
-
|
|
796
|
+
hooks.fire('action:composer.' + action, { composerData: composerData, data: data });
|
|
801
797
|
})
|
|
802
798
|
.catch((err) => {
|
|
803
799
|
// Restore composer on error
|