You are here: Foswiki>Tasks Web>Item2304 (06 Dec 2010, AndrewJones)Edit Attach

Item2304: NatEditPlugin does not take up the full screen on Chrome

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: NatEditPlugin
Branches:
Reported By: AndrewJones
Waiting For:
Last Change By: AndrewJones
The edit box does not take up the full screen when using Google Chrome.

I am using an early dev release and unfortunately I cannot test in the stable release as I can only have one version of Chrome installed.

I have attached a screenshot to show the problem.

Not sure whether this is an important bug, as Chrome has a small market share, so I set the priority to Low.

-- AndrewJones - 28 Oct 2009

Hi Andrew, it works fine for me in 3.0.195.27 (the latest stable I think).

Can you please tell me which version of chrome you are using?

Also: Please try the latest (unreleased) svn checkout of NatEditPlugin, it has some fixes for TinyMCE resizing (but those fixes shouldn't effect NatEditor)...

Edit: Actually, it's worth going through configure and checking that you have the latest version of all your plugins. Some important updates have happened in the last 3-6 months with JQueryPlugin, for example.

-- PaulHarvey - 05 Nov 2009

Thanks Paul.

I used the latest version of all the plugins from a SVN based install (01x00 branch) and still the same problem.

As I said, I am using the dev channel (because I want extensions and bookmarks sync), which is currently 4.0.223.11.

As you have confirmed that it works fine in the latest stable release then we don't need to do anything about this now, but we should be aware that when Chrome 4 is released we may need to revisit this.

-- AndrewJones - 05 Nov 2009

Sorry to flick this back at you Andrew, but like yourself as I can only install one version of chrome (and I lack the time set up new VMs just for windows browsers :-), can you please confirm that NatEdit does not take up the full screen when you resize the window.

There is an autoMaxExpand function that is fired whenever the browser window is resized. I'm just curious if we have a problem with that code, or we just need to change the way we initialize the editor when it is first loaded up (for instance, we use 100ms timeouts in a few places, and I'm wary of these magic arbitrary numbers smile

-- PaulHarvey - 05 Nov 2009

Nope it does not take up the full screen when the browser is fired.

Im pretty sure that the browser would be firing the resize events properly, as I have been doing some work with the ExtJS JavaScript library and have not noticed any problems, so maybe it is those timeouts.

-- AndrewJones - 06 Nov 2009

Just to update to say this bug still exists. Tested in Chrome 8 (stable) on Windows, and Chrome 9 (dev) on Linux. Using latest version from SVN on trunk.

-- AndrewJones - 06 Dec 2010

I have traced the problem down to this if statement, line 621 in jquery.natedit.uncompressed.js:

if ($txtarea.parents(":not(:visible)").length) {

This is always true in Chrome, so it never fixes the height. This is not the case in Firefox....

-- AndrewJones - 06 Dec 2010

This patch fixes it for me. Tested in Chrome 8 and Firefox 3.0, and with JQuery 1.3.2 and 1.4.2.


Index: pub/System/NatEditPlugin/styles.uncompressed.css
===================================================================
--- pub/System/NatEditPlugin/styles.uncompressed.css    (revision 10197)
+++ pub/System/NatEditPlugin/styles.uncompressed.css    (working copy)
@@ -12,6 +12,7 @@
   width:99%;
   font-family:"Bitstream Vera Sans Mono", "Andale Mono", monospace;
   font-size:12px;
+  resize: none;
 }
 ul.natEditButtonBox {
   margin:0px 10px 0px 0px;
Index: pub/System/NatEditPlugin/jquery.natedit.uncompressed.js
===================================================================
--- pub/System/NatEditPlugin/jquery.natedit.uncompressed.js     (revision 10197)
+++ pub/System/NatEditPlugin/jquery.natedit.uncompressed.js     (working copy)
@@ -618,7 +618,7 @@
     minWidth, minHeight, newHeight, newHeightExtra = 0, natEditTopicInfoHeight,
     $debug = $("#DEBUG");
 
-  if ($txtarea.parents(":not(:visible)").length) { // fix for  jquery < 1.3.x
+  if ($txtarea.is(":not(:visible)")) {
     //$.log("natedit textarea not visible ... skipping fixHeight");
     return;
   }

The code still executes when the tab is switched to settings, so confident this is the right fix.

The resize:none; prevents Chrome from allowing the user to resize the text area, which in this situation is probably what we want.

-- AndrewJones - 06 Dec 2010
 

ItemTemplate edit

Summary NatEditPlugin does not take up the full screen on Chrome
ReportedBy AndrewJones
Codebase
SVN Range Foswiki-1.0.7, Sun, 20 Sep 2009, build 5061
AppliesTo Extension
Component NatEditPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:abb46b85b63f
TargetRelease n/a
ReleasedIn n/a
I Attachment Action Size Date Who Comment
natedit-chrome-fullscreen.PNGPNG natedit-chrome-fullscreen.PNG manage 76 K 28 Oct 2009 - 16:13 AndrewJones Screenshot of bug
Topic revision: r8 - 06 Dec 2010, AndrewJones
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy