Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add OnBeforeRestore #28

Merged
merged 1 commit into from

2 participants

@nexik

There is already pull request about it, but I think implementation is little wrong.

I add this request because, when you have dynamic generated forms (by ajax) you first must create this forms before launching restore function.

@simsalabim simsalabim merged commit 955e875 into simsalabim:master
@simsalabim
Owner

@nexik thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 17, 2012
  1. @nexik

    Adding onBeforeRestore event

    nexik authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 sisyphus.js
View
7 sisyphus.js
@@ -111,6 +111,7 @@
autoRelease: true,
name: null,
onSave: function() {},
+ onBeforeRestore: function {},
onRestore: function() {},
onRelease: function() {}
};
@@ -257,7 +258,11 @@
restoreAllData: function() {
var self = this;
var restored = false;
-
+
+ if ( $.isFunction( self.options.onBeforeRestore ) ) {
+ self.options.onBeforeRestore.call();
+ }
+
self.targets.each( function() {
var target = $( this );
var targetFormId = target.attr( "id" );
Something went wrong with that request. Please try again.