-
18 Feb 2011 6:46 AM #1
htmleditor + fontsize + google chrome
htmleditor + fontsize + google chrome
Hi,
It seems that using the font-size option in the htmleditor interface bugs with google chrome (v9.0.597.98) while it works with firefox.
When you try to use the source editor option to manually increase the font size then you try to increase it again with the icon, it reduces the font size to default size. Weird...
-
22 Nov 2011 11:49 AM #2
Our team noticed the same thing with new versions of Safari (5.1) and Chrome (15).
After looking at the Ext source code, it looks like webkit browsers used to return the font size in pixels but now it returns the font size in a number 1 through 7 like the other browsers. The special case code for Safari and Chrome needed to be removed and then it works great!
Old code:
New code:Code:adjustFont: function(btn){ var adjust = btn.getItemId() == 'increasefontsize' ? 1 : -1, doc = this.getDoc(), v = parseInt(doc.queryCommandValue('FontSize') || 2, 10); if((Ext.isSafari && !Ext.isSafari2) || Ext.isChrome || Ext.isAir){ if(v <= 10){ v = 1 + adjust; }else if(v <= 13){ v = 2 + adjust; }else if(v <= 16){ v = 3 + adjust; }else if(v <= 18){ v = 4 + adjust; }else if(v <= 24){ v = 5 + adjust; }else { v = 6 + adjust; } v = v.constrain(1, 6); }else{ if(Ext.isSafari){ adjust *= 2; } v = Math.max(1, v+adjust) + (Ext.isSafari ? 'px' : 0); } this.execCmd('FontSize', v); },
We left the Ext.isAir case because we were not sure if it would still need the special case or not, and we did not test Air clients. If you want to remove the air case as well the code gets much simper:Code:adjustFont: function(btn){ var adjust = btn.getItemId() == 'increasefontsize' ? 1 : -1, doc = this.getDoc(), v = parseInt(doc.queryCommandValue('FontSize') || 2, 10); if(Ext.isAir){ if(v <= 10){ v = 1 + adjust; }else if(v <= 13){ v = 2 + adjust; }else if(v <= 16){ v = 3 + adjust; }else if(v <= 18){ v = 4 + adjust; }else if(v <= 24){ v = 5 + adjust; }else { v = 6 + adjust; } v = v.constrain(1, 6); }else{ v = Math.max(1, v+adjust); } this.execCmd('FontSize', v); },
Code:adjustFont: function(btn){ var adjust = btn.getItemId() == 'increasefontsize' ? 1 : -1, doc = this.getDoc(), v = parseInt(doc.queryCommandValue('FontSize') || 2, 10); v = Math.max(1, v+adjust); this.execCmd('FontSize', v); },
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[DUPE-1096] Strange behaviour of the HtmlEditor in Google Chrome...
By jimshell in forum Ext 3.x: BugsReplies: 4Last Post: 22 Nov 2010, 11:18 PM -
Google Chrome OS
By TopKatz in forum Community DiscussionReplies: 5Last Post: 28 Nov 2009, 9:15 AM -
Ext is not defined in Google Chrome
By dbassett74 in forum Ext 3.x: Help & DiscussionReplies: 4Last Post: 15 Jul 2009, 12:55 PM -
Google Chrome
By evant in forum Community DiscussionReplies: 38Last Post: 3 Sep 2008, 5:15 AM


Reply With Quote