storypioneers / kirby-wysiwyg

WYSIWYG panel field for Kirby CMS
Other
125 stars 17 forks source link

Field initialization runs every time the user hits "Save" #9

Closed JonasDoebertin closed 9 years ago

JonasDoebertin commented 9 years ago

The medium editor is being initialized every time the panel content form is saved. This leads to a large amount of unused instances of the editor and plenty of unnecessary toolbar elements and dynamic CSS rules.

We need to modify the below initialization callback in a way that the initialization runs only when the panel JS application is loaded for the first time. Does this make sense?

(function($) {
    $.fn.wysiwygeditorfield = function() {
        WysiwygEditorField.init(this);
    };
})(jQuery);
JonasDoebertin commented 9 years ago

Fixed with e5f3fe6ef061d5bf1805c8d2c581c55cf0518d4f.

The MediumEditor attached to each field now get's destroyed, when a user leaves the view they where created in.