You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
608 B

  1. 'use strict'
  2. import $ from 'jquery'
  3. module.exports = (alerts, socket) => {
  4. if ($('#page-type-edit').length) {
  5. let pageEntryPath = $('#page-type-edit').data('entrypath')
  6. // let pageCleanExit = false
  7. // -> Discard
  8. $('.btn-edit-discard').on('click', (ev) => {
  9. $('#modal-edit-discard').toggleClass('is-active')
  10. })
  11. // window.onbeforeunload = function () {
  12. // return (pageCleanExit) ? true : 'Unsaved modifications will be lost. Are you sure you want to navigate away from this page?'
  13. // }
  14. require('../components/editor.js')(alerts, pageEntryPath, socket)
  15. }
  16. }