2017-04-01 21:07:01 +00:00
|
|
|
'use strict'
|
2016-08-28 15:27:05 +00:00
|
|
|
|
2017-04-01 21:07:01 +00:00
|
|
|
import $ from 'jquery'
|
2016-08-28 15:27:05 +00:00
|
|
|
|
2017-04-01 21:07:01 +00:00
|
|
|
module.exports = (alerts, socket) => {
|
|
|
|
if ($('#page-type-edit').length) {
|
|
|
|
let pageEntryPath = $('#page-type-edit').data('entrypath')
|
|
|
|
// let pageCleanExit = false
|
2016-08-31 03:38:21 +00:00
|
|
|
|
2017-04-01 21:07:01 +00:00
|
|
|
// -> Discard
|
2016-08-28 15:27:05 +00:00
|
|
|
|
2017-04-01 21:07:01 +00:00
|
|
|
$('.btn-edit-discard').on('click', (ev) => {
|
|
|
|
$('#modal-edit-discard').toggleClass('is-active')
|
|
|
|
})
|
2017-03-25 21:03:09 +00:00
|
|
|
|
2017-04-01 21:07:01 +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
|
|
|
}
|