/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
keys[ 9 ] = 'next'; // TAB\r
keys[ 38 ] = 'prev'; // ARROW-UP\r
keys[ CKEDITOR.SHIFT + 9 ] = 'prev'; // SHIFT + TAB\r
- keys[ 32 ] = 'click'; // SPACE\r
+ keys[ 32 ] = CKEDITOR.env.ie ? 'mouseup' : 'click'; // SPACE\r
+ CKEDITOR.env.ie && ( keys[ 13 ] = 'mouseup' ); // Manage ENTER, since onclick is blocked in IE (#8041).\r
\r
this._.pendingHtml = [];\r
this._.items = {};\r
this._.items[ value ] = id;\r
\r
pendingHtml.push(\r
- '<li id=', id, ' class=cke_panel_listItem>' +\r
+ '<li id=', id, ' class=cke_panel_listItem role=presentation>' +\r
'<a id="', id, '_option" _cke_focus=1 hidefocus=true' +\r
' title="', title || value, '"' +\r
- ' href="javascript:void(\'', value, '\')"' +\r
- ' onclick="CKEDITOR.tools.callFunction(', this._.getClick(), ',\'', value, '\'); return false;"',\r
+ ' href="javascript:void(\'', value, '\')" ' +\r
+ ( CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : 'onclick' ) + // #188\r
+ '="CKEDITOR.tools.callFunction(', this._.getClick(), ',\'', value, '\'); return false;"',\r
' role="option"' +\r
' aria-posinset="' + ++this._.size + '">',\r
html || value,\r
item.addClass( 'cke_selected' );\r
\r
this.element.getDocument().getById( itemId + '_option' ).setAttribute( 'aria-selected', true );\r
- this.element.setAttribute( 'aria-activedescendant', itemId + '_option' );\r
-\r
this.onMark && this.onMark( item );\r
},\r
\r
unmark : function( value )\r
{\r
- this.element.getDocument().getById( this._.items[ value ] ).removeClass( 'cke_selected' );\r
- this.onUnmark && this.onUnmark( this._.items[ value ] );\r
+ var doc = this.element.getDocument(),\r
+ itemId = this._.items[ value ],\r
+ item = doc.getById( itemId );\r
+\r
+ item.removeClass( 'cke_selected' );\r
+ doc.getById( itemId + '_option' ).removeAttribute( 'aria-selected' );\r
+\r
+ this.onUnmark && this.onUnmark( item );\r
},\r
\r
unmarkAll : function()\r
\r
for ( var value in items )\r
{\r
- doc.getById( items[ value ] ).removeClass( 'cke_selected' );\r
+ var itemId = items[ value ];\r
+\r
+ doc.getById( itemId ).removeClass( 'cke_selected' );\r
+ doc.getById( itemId + '_option' ).removeAttribute( 'aria-selected' );\r
}\r
\r
this.onUnmark && this.onUnmark();\r