On 2/8/06, Todd Ross <[EMAIL PROTECTED]> wrote:
> Do either of you have a sample (live site) using InPlaceEditor?  I've
> never used it and I don't see a demo on http://script.aculo.us/.

Nevermind.  I found that the documentation of InPlaceEditor had
samples included.  That site (script.aculo.us) is very inconsistant
... just like the InPlaceEditor!

It's using an input[type="submit"] button for OK but an a (anchor) for
the Cancel?  I can't imagine any scenarios where that would be
considered a "good interface".

I was going to suggest that even if the InPlaceEditor didn't support
the use of images directly, that you could make it work with CSS, but
it would be fugly considering that the "buttons" are created using
different HTML elements.

Just for grins, here's a(n untested) patch to create a cancelButton
(as opposed to the cancelLink) which can be styled to include an
image.

#<formId>-inplaceeditor .ipe_ok {}

#<formId>-inplaceeditor .ipe_cancel {}

Todd
Index: controls.js
===================================================================
--- controls.js	(revision 3533)
+++ controls.js	(working copy)
@@ -461,7 +461,7 @@
     this.options = Object.extend({
       okButton: true,
       okText: "ok",
-      cancelLink: true,
+      cancelButton: true,
       cancelText: "cancel",
       savingText: "Saving...",
       clickToEditText: "Click to edit",
@@ -553,16 +553,18 @@
     if (this.options.okButton) {
       okButton = document.createElement("input");
       okButton.type = "submit";
+      okButton.className = "ipe_ok";
       okButton.value = this.options.okText;
       this.form.appendChild(okButton);
     }
 
-    if (this.options.cancelLink) {
-      cancelLink = document.createElement("a");
-      cancelLink.href = "#";
-      cancelLink.appendChild(document.createTextNode(this.options.cancelText));
-      cancelLink.onclick = this.onclickCancel.bind(this);
-      this.form.appendChild(cancelLink);
+    if (this.options.cancelButton) {
+      cancelButton = document.createElement("input");
+      cancelButton.type = "button";
+      cancelButton.className = "ipe_cancel";
+      cancelButton.value = this.options.cancelText;
+      cancelButton.onclick = this.onclickCancel.bind(this);
+      this.form.appendChild(cancelButton);
     }
   },
   hasHTMLLineBreaks: function(string) {

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to