Skip to content

Instantly share code, notes, and snippets.

@markupboy
Created February 26, 2013 22:19
Show Gist options
  • Save markupboy/5042837 to your computer and use it in GitHub Desktop.
Save markupboy/5042837 to your computer and use it in GitHub Desktop.
registerPane: function(index, elem) {
var $elem = $(elem);
var name = $elem.data('pane');
this.panes[name] = {
url: $elem.prop('href'),
pane: $('#settings_'+name),
link: $elem,
};
this.panes.length++;
$elem.on('click', $.proxy(this.confirmIfDirty, this));
},
confirmIfDirty: function() {
if(this.panes.active.dirty) {
var check = confirm('are you sure?')
if(!check) {
return false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment