Issue with .addClass method of tinymce.dom.DOMUtils class in tinymce 4.3.12
<p>I am trying to migrate from <strong>tinymce version 4.1.9</strong> to latest <strong><a href="https://www.tinymce.com/download/" rel="nofollow">tinymce version 4.3.12</a></strong>. I have a custom button which fires an event and simultaneously toggle (change the image of the button). It works fine with earlier versions of tinymce (all versions of 3.x and 4.1.2) but now giving an error message in tinymce 4.3.12.</p>

<p>Error message is: <code>Uncaught TypeError: self.addClass is not a function</code> in chrome debug console.</p>

<p>I have checked the latest <a href="https://www.tinymce.com/docs/api/class/tinymce.dom.domutils/#addclass" rel="nofollow">documentation</a> and which clearly shows <code>.addClass</code> is part of the library (<a href="https://www.tinymce.com/docs/api/class/tinymce.dom.domutils/#addclass" rel="nofollow">tinymce.dom.DOMUtils</a> class).</p>

<p>See below part of the code I am using:</p>

<pre><code> tinymce.init({
       setup: function (ed) {
                    ed.addButton('autosave', {
                    image:  '/images/autosave_disk_off.png',
                    cmd: 'autosave',
                    selectable: true,
                    onClick: toggleAutoSave,
                    onPostRender: function() {
                      var self = this;
                      self.addClass('classAutosave');
                      ed.on('autosaveStateChanged', function(e) {
                      self.active(e.state);
                         });
                    }});
                  }
              });
</code></pre>

<p>I want to add a class to current element so that image switching can be done. </p>

<p>Can someone help to understand the reason why this code is not working in tinymce 4.3.12? </p>

<p>Is there alternate way to add class in onPostRender?</p>

<p>Thanks</p>