This repository was archived by the owner on Mar 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed
static/djangocms_text_ckeditor/js Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Unreleased
66==========
77
88* Removed inline editing toggle button from touch devices (where it is inactive anyways) and collapsed menus
9-
9+ * Add workaround for toolbar bug in django CMS < 3.10: Reload page after change in inline editor
1010
11115.1.0 (2022-03-24)
1212==================
Original file line number Diff line number Diff line change 256256 } ,
257257
258258 loadToolbar : function ( ) {
259- CMS . API . StructureBoard . _loadToolbar ( )
260- . done ( function ( newToolbar ) {
261- CMS . API . Toolbar . _refreshMarkup ( $ ( newToolbar ) . find ( '.cms-toolbar' ) ) ;
262- } )
263- . fail ( CMS . API . Helpers . reloadBrowser ) ;
259+ if ( CMS . settings && CMS . settings . version && this . _toolbar_bug_version ( CMS . settings . version ) ) {
260+ // Before django CMS 3.10 a bug prevents the toolbar to be loaded correctly
261+ // Refresh whole page instead
262+ CMS . API . Helpers . reloadBrowser ( ) ;
263+ } else {
264+ CMS . API . StructureBoard . _loadToolbar ( )
265+ . done ( function ( newToolbar ) {
266+ CMS . API . Toolbar . _refreshMarkup ( $ ( newToolbar ) . find ( '.cms-toolbar' ) ) ;
267+ } )
268+ . fail ( CMS . API . Helpers . reloadBrowser ) ;
269+ }
270+ } ,
271+
272+ _toolbar_bug_version : function ( version ) {
273+ var parts = version . split ( '.' ) ;
274+
275+ return parts [ 0 ] === '3' && parts [ 1 ] . length < 2 ;
264276 } ,
265277
266278 storeCSSlinks : function ( ) {
Original file line number Diff line number Diff line change 1616
1717
1818# this path is changed automatically whenever you run `gulp bundle`
19- PATH_TO_JS = 'djangocms_text_ckeditor/js/dist/bundle-3d3a4963e8 .cms.ckeditor.min.js'
19+ PATH_TO_JS = 'djangocms_text_ckeditor/js/dist/bundle-5f73f48756 .cms.ckeditor.min.js'
2020
2121
2222class TextEditorWidget (forms .Textarea ):
You can’t perform that action at this time.
0 commit comments