Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10588 (new defect)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Ajax.InPlaceEditor gets incorrect row count when using loadTextURL

Reported by: glennfu Assigned to: thomas@fesch.at
Priority: normal Milestone: 2.x
Component: script.aculo.us Version:
Severity: normal Keywords:
Cc:

Description

var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { ...

Pretty simple and clear problem. The "if" statement should be looking at "text" instead of "this.getText()". This was causing some usages of the InPlaceEditor where loadTextURL returned a single line to be producing multiple lined editors. Patch is attached.

Attachments

control_js_in_place_editor.diff (0.6 kB) - added by glennfu on 12/21/07 16:49:44.
control.js patch file for Ajax.InPlaceEditor

Change History

12/21/07 16:49:44 changed by glennfu

  • attachment control_js_in_place_editor.diff added.

control.js patch file for Ajax.InPlaceEditor

12/22/07 15:59:03 changed by john

+1 - I ran into this same issue. The Ajax.InPlaceEditor creates a multi-line textbox, when it should be a single line, because it checks for newlines in the HTML of the page instead of checking the text from loadTextURL (which didn't have newlines).