eGovPDX / Council-Agenda-App

5 stars 0 forks source link

API Methods for app().modal()s onbeforeunload event (and globally) #32

Open OscarGodson opened 13 years ago

OscarGodson commented 13 years ago

Would like to have interal API methods in app().modal()'s window.onbeforeunload event so we can customize it on a per modal basis.

For example, the "About CouncilConnect" doesn't need a modal at all so it'd be nice to do something like:

app().modal({
  title:'About CouncilConnect',
  content:newHTML,
  confirmClose:false
});

Also, a way to set it so we can have custom messages like:

app().modal({
  title:'About CouncilConnect',
  content:newHTML,
  confirmMessage:'Are you sure you want to close this '+type+' with unsaved changes?'
});

Lastly, we should have an API call for turning it on and off globally so it doesn't have to be in a modal every time. Something like:

app().confirmClose('You sure you want to leave?')

//Later on somewhere else in the code, like in a "close" button or something
app().confirmClose(false);