X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpanelbutton%2Fplugin.js;h=5821c880a6ee8aed4f37a4a807c459f0df9b927f;hb=039a051ccf3901311661022a30afd60fc38130c9;hp=155fa954a09d1dbf223729caa9def2930793d145;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/panelbutton/plugin.js b/_source/plugins/panelbutton/plugin.js index 155fa95..5821c88 100644 --- a/_source/plugins/panelbutton/plugin.js +++ b/_source/plugins/panelbutton/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -57,6 +57,11 @@ CKEDITOR.UI_PANELBUTTON = 4; && panelDefinition.parent.getDocument() ) || CKEDITOR.document; + panelDefinition.block = + { + attributes : panelDefinition.attributes + }; + this.hasArrow = true; this.click = clickFn; @@ -88,8 +93,10 @@ CKEDITOR.UI_PANELBUTTON = 4; return; var panelDefinition = this._.panelDefinition || {}, + panelBlockDefinition = this._.panelDefinition.block, panelParentElement = panelDefinition.parent || CKEDITOR.document.getBody(), panel = this._.panel = new CKEDITOR.ui.floatPanel( editor, panelParentElement, panelDefinition ), + block = panel.addBlock( _.id, panelBlockDefinition ), me = this; panel.onShow = function() @@ -106,7 +113,7 @@ CKEDITOR.UI_PANELBUTTON = 4; me.onOpen(); }; - panel.onHide = function() + panel.onHide = function( preventOnClose ) { if ( me.className ) this.element.getFirst().removeClass( me.className + '_panel' ); @@ -115,7 +122,7 @@ CKEDITOR.UI_PANELBUTTON = 4; _.on = 0; - if ( me.onClose ) + if ( !preventOnClose && me.onClose ) me.onClose(); }; @@ -126,9 +133,9 @@ CKEDITOR.UI_PANELBUTTON = 4; }; if ( this.onBlock ) - this.onBlock( panel, _.id ); + this.onBlock( panel, block ); - panel.getBlock( _.id ).onHide = function() + block.onHide = function() { _.on = 0; me.setState( CKEDITOR.TRISTATE_OFF );