angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 371 forks source link

setup function in uiTinymceConfig is overwritten #254

Closed lucasgranberg closed 8 years ago

lucasgranberg commented 8 years ago

The setup callback from the options object added via attribute was added to the setup callback of the setupOptions in the directive. However the setup function of uiTinymceConfig was not.

As stated in https://github.com/angular-ui/ui-tinymce/issues/143

And now it works. It's an ugly quickfix though, as it doesn't really take into consideration a setup function that would be in the uiTinymceConfig object.

Would it be possible to add it to the directive? I would like to have default settings added via a decorator on uiTinymceConfig.

if (uiTinymceConfig.setup) {
  uiTinymceConfig.setup(ed, {
    updateView: updateView
  });
}
deeg commented 8 years ago

I am not opposed to this. Please feel free to put out a PR!

Edit: Sorry I see you already did. I will look it over and get it merged in.