From 60d8339199d00690375254cc86338018a7a61dc9 Mon Sep 17 00:00:00 2001
From: Jim Lindstrom
',
loadurl : "json.php",
type : "select",
submit : "OK",
- style : "inherit"
+ style : "inherit",
+ showfn : function (elem) { elem.fadeIn('fast'); }
});
$(".editable_textarea").editable("save.php", {
indicator : "
",
@@ -45,7 +47,8 @@
select : true,
submit : 'OK',
cancel : 'cancel',
- cssclass : "editable"
+ cssclass : "editable",
+ showfn : function (elem) { elem.fadeIn('fast'); }
});
$(".editable_textile").editable("save.php?renderer=textile", {
indicator : "
",
@@ -53,32 +56,37 @@
type : "textarea",
submit : "OK",
cancel : "Cancel",
- tooltip : "Click to edit..."
+ tooltip : "Click to edit...",
+ showfn : function (elem) { elem.fadeIn('fast'); }
});
$(".click").editable("echo.php", {
indicator : "
",
tooltip : "Click to edit...",
- style : "inherit"
+ style : "inherit",
+ showfn : function (elem) { elem.fadeIn('fast'); }
});
$(".dblclick").editable("echo.php", {
indicator : "
",
tooltip : "Doubleclick to edit...",
event : "dblclick",
- style : "inherit"
+ style : "inherit",
+ showfn : function (elem) { elem.fadeIn('fast'); }
});
$(".mouseover").editable("echo.php", {
indicator : "
",
tooltip : "Move mouseover to edit...",
event : "mouseover",
- style : "inherit"
+ style : "inherit",
+ showfn : function (elem) { elem.fadeIn('fast'); }
});
/* Should not cause error. */
$("#nosuch").editable("echo.php", {
indicator : "
",
type : 'textarea',
- submit : 'OK'
+ submit : 'OK',
+ showfn : function (elem) { elem.fadeIn('fast'); }
});
});
diff --git a/jquery.jeditable.js b/jquery.jeditable.js
index eb8a911..4da9413 100644
--- a/jquery.jeditable.js
+++ b/jquery.jeditable.js
@@ -15,7 +15,7 @@
*/
/**
- * Version 1.7.2-dev
+ * Version 1.7.3-dev
*
* ** means there is basic unit tests for this parameter.
*
@@ -48,6 +48,7 @@
* @param String options[select] true or false, when true text is highlighted ??
* @param String options[placeholder] Placeholder text or html to insert when element is empty. **
* @param String options[onblur] 'cancel', 'submit', 'ignore' or function ??
+ * @param Function options[showfn] function that can animate ethe element when switching to edit mode **
*
* @param Function options[onsubmit] function(settings, original) { ... } called before submit
* @param Function options[onreset] function(settings, original) { ... } called before reset
@@ -240,9 +241,15 @@
/* Add buttons to the form. */
buttons.apply(form, [settings, self]);
-
+
/* Add created form to self. */
+ if (settings.showfn) {
+ form.hide();
+ }
$(self).append(form);
+ if (settings.showfn) {
+ settings.showfn(form);
+ }
/* Attach 3rd party plugin if requested. */
plugin.apply(form, [settings, self]);