diff --git a/plugins/image/dialogs/image.js b/plugins/image/dialogs/image.js
index 456df17..0959eb1 100644
a
|
b
|
|
599 | 599 | commit: function( type, element, internalCommit ) { |
600 | 600 | var value = this.getValue(); |
601 | 601 | if ( type == IMAGE ) { |
602 | | if ( value && editor.activeFilter.check( 'img{width,height}' ) ) |
603 | | element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) ); |
604 | | else |
| 602 | if ( value ) { |
| 603 | if ( editor.activeFilter.check( 'img[width]' ) ) { |
| 604 | element.setAttribute( 'width', value ); |
| 605 | element.removeStyle( 'width' ); |
| 606 | } else if ( editor.activeFilter.check( 'img{width}' ) ) { |
| 607 | element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) ); |
| 608 | element.removeAttribute( 'width' ); |
| 609 | } |
| 610 | } else { |
| 611 | element.removeAttribute( 'width' ); |
605 | 612 | element.removeStyle( 'width' ); |
606 | | |
607 | | !internalCommit && element.removeAttribute( 'width' ); |
| 613 | } |
608 | 614 | } else if ( type == PREVIEW ) { |
609 | 615 | var aMatch = value.match( regexGetSize ); |
610 | 616 | if ( !aMatch ) { |
611 | 617 | var oImageOriginal = this.getDialog().originalElement; |
612 | 618 | if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) |
613 | | element.setStyle( 'width', oImageOriginal.$.width + 'px' ); |
| 619 | if ( editor.activeFilter.check( 'img[width]' ) ) { |
| 620 | element.setAttribute( 'width', oImageOriginal.$.width ); |
| 621 | element.removeStyle( 'width' ); |
| 622 | } else if ( editor.activeFilter.check( 'img{width}' ) ) { |
| 623 | element.setStyle( 'width', oImageOriginal.$.width + 'px' ); |
| 624 | element.removeAttribute( 'width' ); |
| 625 | } |
| 626 | } |
614 | 627 | } else { |
615 | | element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) ); |
| 628 | if ( editor.activeFilter.check( 'img[width]' ) ) { |
| 629 | element.setAttribute( 'width', value ); |
| 630 | element.removeStyle( 'width' ); |
| 631 | } else if ( editor.activeFilter.check( 'img{width}' ) ) { |
| 632 | element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) ); |
| 633 | element.removeAttribute( 'width' ); |
| 634 | } |
616 | 635 | } |
617 | 636 | } else if ( type == CLEANUP ) { |
618 | 637 | element.removeAttribute( 'width' ); |
… |
… |
|
640 | 659 | commit: function( type, element, internalCommit ) { |
641 | 660 | var value = this.getValue(); |
642 | 661 | if ( type == IMAGE ) { |
643 | | if ( value && editor.activeFilter.check( 'img{width,height}' ) ) |
644 | | element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) ); |
645 | | else |
646 | | element.removeStyle( 'height' ); |
647 | | |
648 | | !internalCommit && element.removeAttribute( 'height' ); |
| 662 | if ( value ) { |
| 663 | if ( editor.activeFilter.check( 'img[height]' ) ) { |
| 664 | element.setAttribute( 'height', value ); |
| 665 | element.removeStyle( 'height' ); |
| 666 | } else if ( editor.activeFilter.check( 'img{height}' ) ) { |
| 667 | element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) ); |
| 668 | element.removeAttribute( 'height' ); |
| 669 | } |
| 670 | } else { |
| 671 | element.removeAttribute( 'width' ); |
| 672 | element.removeStyle( 'width' ); |
| 673 | } |
649 | 674 | } else if ( type == PREVIEW ) { |
650 | 675 | var aMatch = value.match( regexGetSize ); |
651 | 676 | if ( !aMatch ) { |
652 | 677 | var oImageOriginal = this.getDialog().originalElement; |
653 | | if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) |
654 | | element.setStyle( 'height', oImageOriginal.$.height + 'px' ); |
| 678 | if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) { |
| 679 | if ( editor.activeFilter.check( 'img[height]' ) ) { |
| 680 | element.setAttribute( 'height', oImageOriginal.$.height ); |
| 681 | element.removeStyle( 'height' ); |
| 682 | } else if ( editor.activeFilter.check( 'img{height}' ) ) { |
| 683 | element.setStyle( 'height', oImageOriginal.$.height + 'px' ); |
| 684 | element.removeAttribute( 'height' ); |
| 685 | } |
| 686 | } |
655 | 687 | } else { |
656 | | element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) ); |
| 688 | if ( editor.activeFilter.check( 'img[height]' ) ) { |
| 689 | element.setAttribute( 'height', value ); |
| 690 | element.removeStyle( 'height' ); |
| 691 | } else if ( editor.activeFilter.check( 'img{height}' ) ) { |
| 692 | element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) ); |
| 693 | element.removeAttribute( 'height' ); |
| 694 | } |
657 | 695 | } |
658 | 696 | } else if ( type == CLEANUP ) { |
659 | 697 | element.removeAttribute( 'height' ); |