X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Fdom%2Felement.js;h=6c62613bc8242ef3d675fc66b053e14bccb3bbba;hp=77031f07f3ebeac03bdf5d4df72f00025ca01d89;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7 diff --git a/_source/core/dom/element.js b/_source/core/dom/element.js index 77031f0..6c62613 100644 --- a/_source/core/dom/element.js +++ b/_source/core/dom/element.js @@ -88,7 +88,7 @@ CKEDITOR.dom.element.setMarker = function( database, element, name, value ) CKEDITOR.dom.element.clearAllMarkers = function( database ) { for ( var i in database ) - CKEDITOR.dom.element.clearMarkers( database, database[i], true ); + CKEDITOR.dom.element.clearMarkers( database, database[i], 1 ); }; CKEDITOR.dom.element.clearMarkers = function( database, element, removeFromDatabase ) @@ -1170,13 +1170,13 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, function() { this.$.style.MozUserSelect = 'none'; - this.on( 'dragstart', function (evt) { evt.data.preventDefault(); } ); + this.on( 'dragstart', function( evt ) { evt.data.preventDefault(); } ); } : CKEDITOR.env.webkit ? function() { this.$.style.KhtmlUserSelect = 'none'; - this.on( 'dragstart', function (evt) { evt.data.preventDefault(); } ); + this.on( 'dragstart', function( evt ) { evt.data.preventDefault(); } ); } : function() @@ -1545,12 +1545,20 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, if ( isBorderBox && !( CKEDITOR.env.ie && CKEDITOR.env.quirks ) ) { var adjustment = 0; - for ( var i = 0, len = sides [ type ].length; i < len; i++ ) - adjustment += parseInt( this.getComputedStyle( sides [ type ][ i ] ) || 0, 10 ); + for ( var i = 0, len = sides[ type ].length; i < len; i++ ) + adjustment += parseInt( this.getComputedStyle( sides [ type ][ i ] ) || 0, 10 ) || 0; size -= adjustment; } this.setStyle( type, size + 'px' ); } }; - })() + })(), + + /** + * Gets element's direction. Supports both CSS 'direction' prop and 'dir' attr. + */ + getDirection : function( useComputed ) + { + return useComputed ? this.getComputedStyle( 'direction' ) : this.getStyle( 'direction' ) || this.getAttribute( 'dir' ); + } });