wikijs-fork/client/js/pages/edit.js

23 lines
608 B
JavaScript
Raw Normal View History

'use strict'
2016-08-28 15:27:05 +00:00
import $ from 'jquery'
2016-08-28 15:27:05 +00:00
module.exports = (alerts, socket) => {
if ($('#page-type-edit').length) {
let pageEntryPath = $('#page-type-edit').data('entrypath')
// let pageCleanExit = false
// -> Discard
2016-08-28 15:27:05 +00:00
$('.btn-edit-discard').on('click', (ev) => {
$('#modal-edit-discard').toggleClass('is-active')
})
2017-03-25 21:03:09 +00:00
// window.onbeforeunload = function () {
// return (pageCleanExit) ? true : 'Unsaved modifications will be lost. Are you sure you want to navigate away from this page?'
// }
require('../components/editor.js')(alerts, pageEntryPath, socket)
}
2017-02-09 01:52:37 +00:00
}