MediaWiki:Common.js: различия между версиями

Материал из melioration.space
Строка 13: Строка 13:
 
         {
 
         {
 
         console.log("Обновление");
 
         console.log("Обновление");
if ( MathJax ) MathJax.typeset();
+
        setTimeout(MathJax.typeset, 100);
 +
//if ( MathJax ) MathJax.typeset();
 
         } catch(err){
 
         } catch(err){
 
             console.log('Error in Gadget-Rechtschreibpruefung.js:documentUpdate');
 
             console.log('Error in Gadget-Rechtschreibpruefung.js:documentUpdate');

Версия 20:35, 25 декабря 2020

mw.hook( 've.activationComplete' ).add( function() {
	console.log("Назначение");
	if ( MathJax ) MathJax.typeset();
    var view =ve.init.target.getSurface().getView();
    var doc = view.getDocument();
    var model = ve.init.target.getSurface().getModel();
    var surface = ve.init.target.getSurface();
    doc.on('nodeAttached', function () { 
    	console.log("Обновление12");
    });
    model.on( 'contextChange', function () {
        try
        {
        	console.log("Обновление");
        	setTimeout(MathJax.typeset, 100);
			//if ( MathJax ) MathJax.typeset();
        } catch(err){
            console.log('Error in Gadget-Rechtschreibpruefung.js:documentUpdate');
            console.log(err);
        }
    } );
});