Medium.js icon indicating copy to clipboard operation
Medium.js copied to clipboard

2.0 alpha - undefined on invoke element

Open bearded-avenger opened this issue 10 years ago • 1 comments

Just a heads up, invoke element is returning an undefined in Chrome. Possibly the same as https://github.com/jakiestfu/Medium.js/issues/131

http://cl.ly/image/1S0J1q1o2b2w

        document.getElementById('make-my-shit-bold').onmousedown = function() {
            article.highlight();
            articleMedium.invokeElement('b');
            return false;
        };

This is now returning Uncaught TypeError: Cannot read property 'remove' of undefined in Chrome.

bearded-avenger avatar Mar 07 '15 00:03 bearded-avenger

I encountered this as well, in my instance attributes was not specified because i did not need to set any. You can place a blank {} in attributes or go into Medium.js and change:

Line 557 - remove = attributes.remove || [];

to

Line 557 - remove = ( attributes ? attributes.remove || [] : [] );

optimus-code avatar Jul 04 '15 03:07 optimus-code