X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpanel%2Fplugin.js;h=6dc1616402e6e52889faacb606c7692f475f4017;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=ae712c0d780a5710aae3dd60f844d022188b99ca;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/_source/plugins/panel/plugin.js b/_source/plugins/panel/plugin.js index ae712c0..6dc1616 100644 --- a/_source/plugins/panel/plugin.js +++ b/_source/plugins/panel/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -16,7 +16,7 @@ CKEDITOR.plugins.add( 'panel', * @constant * @example */ -CKEDITOR.UI_PANEL = 2; +CKEDITOR.UI_PANEL = 'panel'; CKEDITOR.ui.panel = function( document, definition ) { @@ -137,6 +137,13 @@ CKEDITOR.ui.panel.prototype = langCode = parentDiv.getParent().getAttribute( 'lang' ), doc = iframe.getFrameDocument(); + // Make it scrollable on iOS. (#8308) + CKEDITOR.env.iOS && parentDiv.setStyles( + { + 'overflow' : 'scroll', + '-webkit-overflow-scrolling' : 'touch' + }); + var onLoad = CKEDITOR.tools.addFunction( CKEDITOR.tools.bind( function( ev ) { this.isLoaded = true; @@ -149,13 +156,10 @@ CKEDITOR.ui.panel.prototype = '' + '' + '' + + CKEDITOR.tools.buildStyleHtml( this.css ) + '' + '' + - // It looks strange, but for FF2, the styles must go - // after , so it (body) becames immediatelly - // available. (#3031) - CKEDITOR.tools.buildStyleHtml( this.css ) + '<\/html>'; doc.write( data ); @@ -220,13 +224,12 @@ CKEDITOR.ui.panel.prototype = { var blocks = this._.blocks, block = blocks[ name ], - current = this._.currentBlock, - holder = this.forceIFrame ? - this.document.getById( this.id + '_frame' ) - : this._.holder; + current = this._.currentBlock; - // Disable context menu for block panel. - holder.getParent().getParent().disableContextMenu(); + // ARIA role works better in IE on the body element, while on the iframe + // for FF. (#8864) + var holder = !this.forceIFrame || CKEDITOR.env.ie ? + this._.holder : this.document.getById( this.id + '_frame' ); if ( current ) { @@ -245,16 +248,6 @@ CKEDITOR.ui.panel.prototype = this._.onKeyDown = block.onKeyDown && CKEDITOR.tools.bind( block.onKeyDown, block ); - block.onMark = function( item ) - { - holder.setAttribute( 'aria-activedescendant', item.getId() + '_option' ); - }; - - block.onUnmark = function() - { - holder.removeAttribute( 'aria-activedescendant' ); - }; - block.show(); return block; @@ -380,11 +373,12 @@ CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass( return false; case 'click' : + case 'mouseup' : index = this._.focusIndex; link = index >= 0 && this.element.getElementsByTag( 'a' ).getItem( index ); if ( link ) - link.$.click ? link.$.click() : link.$.onclick(); + link.$[ keyAction ] ? link.$[ keyAction ]() : link.$[ 'on' + keyAction ](); return false; }