MDL-34990 fix JS error when moodlenolink button not present in toolbar

Thanks Rossiani Wijaya for discovering this issue!
This commit is contained in:
Petr Škoda 2012-08-29 09:57:32 +02:00 committed by Aparup Banerjee
parent 730d005383
commit 5854be2587

View File

@ -43,6 +43,10 @@
ed.onNodeChange.add(function(ed, cm, n) {
var p, c;
c = cm.get('moodlenolink');
if (!c) {
// Button not used.
return;
}
p = ed.dom.getParent(n, 'SPAN');
c.setActive(p && ed.dom.hasClass(p, 'nolink'));