Tinymce is turning off textarea resize globally on all textarea including the textareas that tinymce does not control.

This patch turns back on resize for textarea's it has nothing to do with.

Comments

m3avrck’s picture

Hi Gordon, I had fixed this earlier, but you're right, it is not working right now. However, your patch is redundant, as this is already being taken care of on line 101. However, for some reason, something in forms API changed so now #resizable isn't being honored. I'm not sure if this has something to do with #after-build or not. But it looks like the problem is how core changed so I'm not sure what we need to change circa line 101 to get it to work. I'll have to do some digging but right now I don't have any more time to look into it.

gordon’s picture

I saw that and it doesn't do it. If the _tinymce_page_match() (line 94) returns a false, which happens to any textarea that is exclued from the profile, then line 101 doesn't get called to set the resize back to true.

m3avrck’s picture

Status: Needs review » Fixed

Gordon, ah yes, very good catch! Thanks, fixed.

Waldemar’s picture

Hm... It seems that now fields are ALWAYS resizable no matter what #resizable is set to...

m3avrck’s picture

Make sure you set "Enable resizing button:" to false under "Editor Appearance" on the profile page for TinyMCE. This is on by default.

Waldemar’s picture

Thanks for the reply. Yes, ok, but shouldn't I be able to controll it with the #resizable option no matter what the TinyMCE Option is set to when TinyMCE is not controlling a textarea? It took me quite a while to figure out that TinyMCE was the reason for this. I don't see any easy workaround if I want TinyMCE to control certain fields and the textarea to be resizable there, but not use TinyMCE on other pages and get the usual drupal behaviour.

Any ideas?

Anonymous’s picture

Status: Fixed » Closed (fixed)
RobRoy’s picture

Version: » 4.7.x-1.x-dev
Status: Closed (fixed) » Active

Now, the textareas that TinyMCE does NOT control that I have set '#resizable' => FALSE have the grippie bar under them still. When I turn of TinyMCE this works as desired. So we need to find out what the set value of the $element's #resizable field is and use that instead of defaulting to TRUE always.

RobRoy’s picture

I commented out the $element['#resizable'] = TRUE; lines on 101 and 221 to keep the default value and it works as desired (for me at least). What am I missing?

bomarmonk’s picture

I copied the screen.css from the tinymce installation into my theme's directory. I then set the path for the css to this location (in the tinymce module's settings page). This made the resizeable AJAX text areas work for me.... I'm not sure if this is just a sloppy accident, but I'll keep the behavior for the time being-- otherwise the resizing did not work.

RobRoy’s picture

Title: Resize textarea not working on textareas that tinymce doesn't control. » Tinymce not honoring #resizable on non-TinyMCE textareas

This is still a bug. tinymce_elements() is setting resizable to FALSE to prevent drupal.js from adding a resize bar to the textarea, but this overrides whatever you set #resizable to in your form. We need a way to preserve the orginal element #resizable property and then pass that to tinymce_process_textarea(). Hmmm...but hook_elements() doesn't let you access the element to store this.

Thoughts?

RobRoy’s picture

Status: Active » Needs review
StatusFileSize
new1.65 KB

Okay, I shifted the behavior to keep the current settings and set #resizable to FALSE if we ARE processing this textarea with TinyMCE. I've tested it and it looks like it's honoring the #resizable property for non-TinyMCE textareas now.

kreynen’s picture

Status: Needs review » Closed (duplicate)
RobRoy’s picture

Status: Closed (duplicate) » Active

Let's not mark this a duplicate of a summary issue. We need specific issues and this one has been around for a long time. My solution has worked well for me, anyone care to comment?

kreynen’s picture

I'm not saying that this isn't working, but there are simply too many issues in the queue to figure out what is actually an issue and what has been resolved. I've slogging through these a few at a time for weeks, but today I buckled down during a few of the sessions at OSCMS and started clearing out all the 4.6 issues and sorting the remaining feature requests and conflicts. I've categorized many of the remaining issue in these 3 categories...

Summary of textarea on/off by content type Request
Summary of gzip/compressor Issues
Summary of Width CSS/Resizing Issues
Summary of Filters/HTML cleanup Issues
Summary of Translation Issues

My goal with all of this is make sure there is a clear plan for how these can be implemented with the new JQuery, form based customization approach. I don't want to get the jquery version is out there, only to realize that old issues have resurfaced and can't be corrected in the jquery version.

If your interested in seeing this rolled into TinyMCE, please join the TinyMCE Development Group. There are several issues regarding resizing that aren't solved with the JQuery approach. I haven't looked at this patch yet, but I plan to.

johnalbin’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Active » Reviewed & tested by the community
StatusFileSize
new1.39 KB

I saw Kevin's g.d.o request to fix the #resizable bug and I came up with a patch.

I wish I saw this issue first, as my fix is IDENTICAL to Rob's 4 month old patch for 4.7.x-1.x-dev.

The attached patch is rolled against 5.x-1.x-dev.

DaveNotik’s picture

Does this patch address that when resize is turned on in TinyMCE profile, it is redundant because Drupal's default one is there?

Is the way to just have one to turn off TinyMCE's and get Drupal's working?

Does this patch work with 5.1?

Thank you!

--D

johnalbin’s picture

Dave: yes. To all questions. Try it. If it works, report back here.

Not sure why it hasn't already been committed. Kevin has a real life apparently. ;-)

DaveNotik’s picture

Got the patch to work.

Yes, it removes the Drupal resize, turning on TinyMCE one works.

(A note on the two resize "interfaces". The TinyMCE seems to indicate you can stretch horizontal and vertical, but Drupal one makes more sense since you can only stretch vertical.)

--D

Jomel’s picture

With JohnAlbin's patch in #16, none of my textareas are resizeable, even those without TinyMCE (for example because none of the user's Roles match a TinyMCE profile, although they do have access to TinyMCE).

Drupal: 5.1
TinyMCE: $Revision: 1.90.4.16 $ $Date: 2007/02/25 20:02:44 $

Jomel’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.88 KB

Firstly, I'll be more specific...

Without the patch in #16:

  • If user's role(s) have no access, textareas are (drupal) resizable as normal [GOOD]
  • If user's role(s) have access but no TinyMCE profile setup, textareas are (drupal) resizeable as normal [GOOD]
  • If user's roles(s) have a TinyMCE profile, textareas are (drupal) resizable as normal [BAD], even though the drupal resizer does nothing

With the patch in #16:

  • If user's role(s) have no access, textareas are (drupal) resizable as normal [GOOD]
  • If user's role(s) have access but no TinyMCE profile setup, textareas are *never* (drupal) resizeable [BAD]
  • If user's roles(s) have a TinyMCE profile, textareas are never (drupal) resizable [OK]

However, I've attached a modified version of JohnAlbin's patch which fixes this, so users with access but no TinyMCE profile setup have their textareas (drupal) resizable as normal.
Disclaimer: I don't have much experience with Drupal or TinyMCE, so someone who knows what they're doing should review the change.

Minor remaining issue (the reason I only put OK above):
If TinyMCE processes a textarea, when rich-text is disabled that textarea won't be (drupal) resizable. This is particularly noticeable if you have TinyMCE default to off. The best approach would be to somehow disable drupal resizable only when TinyMCE actually loads (tinyMCE.addMCEControl) for the textarea (e.g. when the user clicks enable rich-text), and re-enable it if the user clicks disable rich-text (tinyMCE.removeMCEControl).

johnalbin’s picture

Status: Needs review » Reviewed & tested by the community

John, thanks for reviewing the patch!

“If user's role(s) have access but no TinyMCE profile setup,” then the site admin has mis-configured TinyMCE; which unfortunately is too easy to do and is whole other can of worms. However, you solution is simple, so +1 for including it.

I‘ve opened #140039 regarding the “textareas not resizable if rich-text is disabled” issue.

+1 Patch is RTBC.

m3avrck’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)
alex.k@drupal.org’s picture

Version: 5.x-1.x-dev » 4.7.x-1.x-dev
Status: Closed (fixed) » Needs review
StatusFileSize
new1.88 KB

Seems like this fix went into 5.x but the 4.7 branch did not get it.

Could you apply the same fix to the 4.7 branch? I'm attaching basically the same patch as in #21 but taken against the 4.7 version.

Thanks!

mupsi’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)