X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Flistblock%2Fplugin.js;h=848cc2aa99a1ec537ecd88dd89a07ee378eeacdc;hp=3ca89ad2101774d66f5a6d837d61440a908d271e;hb=059b4c2fef02528bf1af189f7996e80652faddfb;hpb=c6e377a02b54abc07129d72b632763c727476a15 diff --git a/_source/plugins/listblock/plugin.js b/_source/plugins/listblock/plugin.js index 3ca89ad..848cc2a 100644 --- a/_source/plugins/listblock/plugin.js +++ b/_source/plugins/listblock/plugin.js @@ -9,21 +9,27 @@ CKEDITOR.plugins.add( 'listblock', onLoad : function() { - CKEDITOR.ui.panel.prototype.addListBlock = function( name, multiSelect ) + CKEDITOR.ui.panel.prototype.addListBlock = function( name, definiton ) { - return this.addBlock( name, new CKEDITOR.ui.listBlock( this.getHolderElement(), multiSelect ) ); + return this.addBlock( name, new CKEDITOR.ui.listBlock( this.getHolderElement(), definiton ) ); }; CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass( { base : CKEDITOR.ui.panel.block, - $ : function( blockHolder, multiSelect ) + $ : function( blockHolder, blockDefinition ) { - // Call the base contructor. - this.base( blockHolder ); + blockDefinition = blockDefinition || {}; + + var attribs = blockDefinition.attributes || ( blockDefinition.attributes = {} ); + ( this.multiSelect = !!blockDefinition.multiSelect ) && + ( attribs[ 'aria-multiselectable' ] = true ); + // Provide default role of 'listbox'. + !attribs.role && ( attribs.role = 'listbox' ); - this.multiSelect = !!multiSelect; + // Call the base contructor. + this.base.apply( this, arguments ); var keys = this.keys; keys[ 40 ] = 'next'; // ARROW-DOWN @@ -79,18 +85,21 @@ CKEDITOR.plugins.add( 'listblock', if ( !this._.started ) { - pendingHtml.push( '