[ 9 posts ]

Max

  • Username: Halfist
  • Joined: Thu Aug 09, 2012 5:51 am
  • Posts: 74
  • Offline
  • Profile

YUI Editor font name defect in Firefox

Post Posted: Thu Aug 09, 2012 6:09 am
+0-
Hi, guys!

I'm using YUI Editor in my project and I have the following problem.

Font name is stuck on "Arial" after using "Ctrl+A" for selecting all text inside the editor and changing font to any from list.

In other words, here are the steps to reproduce it (in Firefox only):
1. Go, for example, here.
2. Press "Ctrl+A" to select all the text inside the editor.
3. Change font by selecting from the dropdown list.
4. Observe the result.

Actual result: font changes, but label not.
Expected result: both font and label changes.

I'm sorry if there is a ticket for this defect I haven't found.

Thanks for any help!

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: YUI Editor font name defect in Firefox

Post Posted: Thu Aug 09, 2012 6:41 am
+0-
This is a known issue, since you are selecting multiple elements Editor will default to the top of the list of fonts since it can't display the selection of several fonts at once.

Max

  • Username: Halfist
  • Joined: Thu Aug 09, 2012 5:51 am
  • Posts: 74
  • Offline
  • Profile

Re: YUI Editor font name defect in Firefox

Post Posted: Thu Aug 09, 2012 6:49 am
+0-
Thanks, Dav!

But font jumps to "Arial" not only after "Ctrl+A", it does it after changing font to another. I mean, when all the editor's inside text font is, for example, "Verdana" (not several fonts), it still shows "Arial". Though, if select all the text by cursor dragging and change the font, then everything is fine.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: YUI Editor font name defect in Firefox

Post Posted: Thu Aug 09, 2012 7:10 am
+0-
When there is more than one item in the selection, Editor bails on even looking at the fonts since it doesn't support showing multiple fonts. Selecting with the cursor is different, it goes by mouseup and sets the font to where the mouse was lifted.

Max

  • Username: Halfist
  • Joined: Thu Aug 09, 2012 5:51 am
  • Posts: 74
  • Offline
  • Profile

Re: YUI Editor font name defect in Firefox

Post Posted: Thu Aug 09, 2012 7:21 am
+0-
Dave, is this issue fixed in YUI 3 Editor? If it's not, could you, please, give me any advice of how to fix it by myself, performing some changes in the editor code? Thanks!


Last edited by Halfist on Thu Aug 09, 2012 8:25 am, edited 1 time in total.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: YUI Editor font name defect in Firefox

Post Posted: Thu Aug 09, 2012 8:25 am
+0-
There is no GUI to the 3.x Editor, so it's "sort of" fixed since you control the buttons and how they activate ;)

I haven't looked at the 2.x Editor in more than 2 years. Off the top of my head I would say you could:

* Listen for the `afterNodeChange` event
* Determine what you want the menu to be set to
* Set it

Max

  • Username: Halfist
  • Joined: Thu Aug 09, 2012 5:51 am
  • Posts: 74
  • Offline
  • Profile

Re: YUI Editor font name defect in Firefox

Post Posted: Fri Aug 10, 2012 1:49 am
+0-
davglass wrote:
This is a known issue, since you are selecting multiple elements Editor will default to the top of the list of fonts since it can't display the selection of several fonts at once.


Dav, but why in IE9 and Google Chrome it defaults not to the top of the list, but to the "Times New Roman"? I'd prefer it will default to empty string, like in MS Word in that cases, if it's possible.

Max

  • Username: Halfist
  • Joined: Thu Aug 09, 2012 5:51 am
  • Posts: 74
  • Offline
  • Profile

Re: YUI Editor font name defect in Firefox

Post Posted: Fri Aug 10, 2012 8:27 am
+0-
In FF after:
Code:
family = Dom.getStyle(elm, 'font-family');
family comes to 'serif', when actual font is another. Dav, have you any ideas why is it so?

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: YUI Editor font name defect in Firefox

Post Posted: Fri Aug 10, 2012 9:16 am
+0-
Without looking at the code I can't tell you, but just so you know IE9 and Chrome did not exist when these components were written nor have they ever been tested on them. So they are pretty unpredictable in what they support or how they act.
  [ 9 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum