/
githubmirror
/
impress.js
Обзор
Документация
Войти
/
githubmirror
/
impress.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/plugins/stop/stop.js
34 строки
905 B
Henrik Ingo
Add a framework for synchronously executed preInit and preStepLeave plugins.
21 окт 2017, 12:22
21 окт 2017, 12:22
82ff7cb
Код
Авторство
О чём код?
/** * Stop Plugin * * Example: * * <!-- Stop at this slide. * (For example, when used on the last slide, this prevents the * presentation from wrapping back to the beginning.) --> * <div class="step stop"> * * Copyright 2016 Henrik Ingo (@henrikingo) * Released under the MIT license. */ /* global document, window */ ( function( document, window ) { "use strict"; var stop = function( event ) { if ( ( !event ) || ( !event.target ) ) { return; } if ( event.target.classList.contains( "stop" ) ) { if ( event.detail.reason === "next" ) { return false; } } }; // Register the plugin to be called in pre-stepleave phase // The weight makes this plugin run fairly early. window.impress.addPreStepLeavePlugin( stop, 2 ); } )( document, window );