nodebb-plugin-composer-default 7.0.19 → 7.0.20

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": "7.0.19",
3
+ "version": "7.0.20",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -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>');
@@ -367,10 +367,7 @@ define('composer', [
367
367
  return removeComposerHistory();
368
368
  }
369
369
 
370
- // Exit fullscreen
371
- if (screenfull.isEnabled && screenfull.isFullscreen) {
372
- screenfull.exit();
373
- }
370
+ formatting.exitFullscreen();
374
371
 
375
372
  var btn = $(this).prop('disabled', true);
376
373
  translator.translate('[[modules:composer.discard]]', function (translated) {