diff options
author | Trent Richardson <trentdrichardson@gmail.com> | 2012-08-01 16:03:58 -0400 |
---|---|---|
committer | Trent Richardson <trentdrichardson@gmail.com> | 2012-08-01 16:03:58 -0400 |
commit | 2c68aa53cadde361a90f9107ce236125a522a47a (patch) | |
tree | 0148ef6aa153dfb87c8a222cd3d903c1f1017554 | |
parent | 43e74f76bf400aca9afca287639fb696a6eb8649 (diff) | |
download | jQuery-Impromptu-2c68aa53cadde361a90f9107ce236125a522a47a.zip jQuery-Impromptu-2c68aa53cadde361a90f9107ce236125a522a47a.tar.gz jQuery-Impromptu-2c68aa53cadde361a90f9107ce236125a522a47a.tar.bz2 |
Fixes #7 with html entities in buttons
-rw-r--r-- | jquery-impromptu.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/jquery-impromptu.js b/jquery-impromptu.js index 4aa9665..d69a766 100644 --- a/jquery-impromptu.js +++ b/jquery-impromptu.js @@ -1,8 +1,8 @@ /*
* jQuery Impromptu
* By: Trent Richardson [http://trentrichardson.com]
- * Version 4.0.3
- * Last Modified: 06/08/2012
+ * Version 4.0.4
+ * Last Modified: 08/01/2012
*
* Copyright 2012 Trent Richardson
* You may use this project under MIT or GPL licenses.
@@ -101,11 +101,12 @@ $state.bind('promptsubmit', stateobj.submit);
$state.children('.'+ $.prompt.options.prefix +'buttons').children('button').click(function(){
- var msg = $state.children('.'+ $.prompt.options.prefix +'message');
- var clicked = stateobj.buttons[$(this).text()];
+ var $t = $(this),
+ msg = $state.children('.'+ $.prompt.options.prefix +'message'),
+ clicked = stateobj.buttons[$t.text()] || stateobj.buttons[$t.html()];
if(clicked == undefined){
for(var i in stateobj.buttons)
- if(stateobj.buttons[i].title == $(this).text())
+ if(stateobj.buttons[i].title == $t.text() || stateobj.buttons[i].title == $t.html())
clicked = stateobj.buttons[i].value;
}
|