diff options
author | Trent Richardson <trentdrichardson@gmail.com> | 2014-04-04 13:50:00 -0400 |
---|---|---|
committer | Trent Richardson <trentdrichardson@gmail.com> | 2014-04-04 13:50:00 -0400 |
commit | 26019c584d62bca31f074b95dc10cd5fa1d96f5b (patch) | |
tree | a507865a305ff8d694f8d3c0a93805e4b0b5a1a4 /dist/jquery-impromptu.js | |
parent | 5c016ed2b84785e3a9ca8242112d371e611efee4 (diff) | |
download | jQuery-Impromptu-26019c584d62bca31f074b95dc10cd5fa1d96f5b.zip jQuery-Impromptu-26019c584d62bca31f074b95dc10cd5fa1d96f5b.tar.gz jQuery-Impromptu-26019c584d62bca31f074b95dc10cd5fa1d96f5b.tar.bz2 |
#30 add newState parameter to removeState method
Diffstat (limited to 'dist/jquery-impromptu.js')
-rw-r--r-- | dist/jquery-impromptu.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/dist/jquery-impromptu.js b/dist/jquery-impromptu.js index c1477f6..0a3e66b 100644 --- a/dist/jquery-impromptu.js +++ b/dist/jquery-impromptu.js @@ -486,11 +486,12 @@ };
/**
- * removeState - Removes a state from the promt
+ * removeState - Removes a state from the prompt
* @param state String - Name of the state
+ * @param newState String - Name of the state to transition to
* @return Boolean - returns true on success, false on failure
*/
- $.prompt.removeState = function(state) {
+ $.prompt.removeState = function(state, newState) {
var $state = $.prompt.getState(state),
rm = function(){ $state.remove(); };
@@ -500,7 +501,10 @@ // transition away from it before deleting
if($state.css('display') !== 'none'){
- if($state.next().length > 0){
+ if(newState !== undefined && $.prompt.getState(newState).length > 0){
+ $.prompt.goToState(newState, false, rm);
+ }
+ else if($state.next().length > 0){
$.prompt.nextState(rm);
}
else{
|