8000 Fixed a bug when toolbar js is rendered before toolbar (#6270) · django-cms/django-cms@7d7d433 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d7d433

Browse files
committed
Fixed a bug when toolbar js is rendered before toolbar (#6270)
1 parent ee4e3e4 commit 7d7d433

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CHANGELOG.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
=== 3.5.1 (unreleased) ===
22

3-
* Fixed a ``MultipleObjectsReturned`` exception raised on the page types migration
3+
* Fixed a ``MultipleObjectsReturned`` exception raised on the page types migration
44
with multiple page types per site.
5+
* Fixed a bug which prevented toolbar js from working correctly when rendered
6+
before toolbar.
57

68

79
=== 3.5.0 (2018-01-31) ===

cms/static/cms/js/dist/3.5.0/bundle.toolbar.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cms/static/cms/js/toolbar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ import StructureBoard from './modules/cms.structureboard';
2424
import Toolbar from './modules/cms.toolbar';
2525
import Tooltip from './modules/cms.tooltip';
2626

27-
// CMS by this time is a global that has `_plugins` property
27+
// CMS by this time should be a global that has `_plugins` property
28+
const CMS = window.CMS || {};
29+
30+
CMS._plugins = CMS._plugins || [];
31+
2832
CMS.Messages = Messages;
2933
CMS.ChangeTracker = ChangeTracker;
3034
CMS.Modal = Modal;

cms/templates/cms/toolbar/toolbar_with_structure.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ <h1>{% trans "This page has no preview!" %}</h1>
8585
{% endif %}
8686
<script type="text/javascript" data-cms>
8787
var CMS = CMS || {};
88-
CMS._plugins = [];
88+
CMS._plugins = CMS._plugins || [];
8989
</script>
9090
{% endblock toolbar_bottom %}

0 commit comments

Comments
 (0)
0