Created
October 9, 2015 19:09
-
-
Save thenoseman/ed8068c4e480d4c59719 to your computer and use it in GitHub Desktop.
TeardownContent function in FoF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rules = [{ | |
// This demonstrates: | |
// - usage of setupContent | |
// - usage of context.storage in setupContent/teardownContent/value function | |
// - the fact that all three functions have the same context available | |
"url": /20-teardown-content/, | |
"name": "Teardown content function", | |
"setupContent": function() { | |
context.storage.set("setBySetupContent", "setBySetupContent"); | |
}, | |
"teardownContent": function() { | |
jQuery("#target").val(context.storage.get("setBySetupContent")); | |
jQuery("#target2").val(context.storage.get("setByValueFunction")); | |
jQuery("#target3").val("set by teardownContent"); | |
}, | |
"fields": [{ | |
"selector": "input", | |
"value": function($e, data) { | |
context.storage.set("setByValueFunction", "setByValueFunction"); | |
return "filled by field def"; | |
} | |
}] | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment