Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't cancel blur effect when buttons are present

  • Loading branch information...
commit 00ecb3a754729ecd95c7224df19eb2d3ed56e848 1 parent 369da80
@sbfaulkner authored
Showing with 7 additions and 10 deletions.
  1. +7 −10 public/javascripts/jquery.inplace.js
View
17 public/javascripts/jquery.inplace.js
@@ -52,7 +52,7 @@
* @param String options[save_button] image button tag to use as "Save" button
* @param String options[cancel_button] image button tag to use as "Cancel" button
* @param String options[show_buttons] will show the buttons: cancel or save; will automatically cancel out the onBlur functionality
-* @param String options[on_blur] what to do on blur: "save" or null; default: "save"; will be overridden if $param show_buttons is true
+* @param String options[on_blur] what to do on blur: "save", "cancel" or null; default: "save"
* @param Function options[callback] call function instead of submitting to url
* @param Function options[success] this function gets called if server responds with a success
* @param Function options[error] this function gets called if server responds with an error
@@ -283,15 +283,12 @@ jQuery.fn.editInPlace = function(options) {
/* CLICK SAVE BUTTON functionality */
original_element.children("form").children(".inplace_save").click(saveAction);
- /* if cancel/save buttons should be shown, cancel blur functionality */
- if(!settings.show_buttons){
- /* if on_blur is set to save, set the save funcion */
- if(settings.on_blur == "save")
- original_element.children("form").children(".inplace_field").blur(saveAction);
- /* if on_blur is set to cancel, set the cancel funcion */
- else
- original_element.children("form").children(".inplace_field").blur(cancelAction);
- }
+ /* if on_blur is set to save, set the save funcion */
+ if(settings.on_blur == "save")
+ original_element.children("form").children(".inplace_field").blur(saveAction);
+ /* if on_blur is set to cancel, set the cancel funcion */
+ else if(settings.on_blur == "cancel")
+ original_element.children("form").children(".inplace_field").blur(cancelAction);
/* hit esc key */
$(document).keyup(function(event){
Please sign in to comment.
Something went wrong with that request. Please try again.