Ticket #3679: 3679.patch
File 3679.patch, 2.3 KB (added by , 15 years ago) |
---|
-
_source/core/dom/element.js
1 /*1 /* 2 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 151 151 */ 152 152 removeClass : function( className ) 153 153 { 154 var c = this. $.className;154 var c = this.getAttribute( 'class' ); 155 155 if ( c ) 156 156 { 157 var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', ' ' );157 var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', 'i' ); 158 158 if ( regex.test( c ) ) 159 159 { 160 160 c = c.replace( regex, '' ).replace( /^\s+/, '' ); 161 161 162 162 if ( c ) 163 this. $.className = c;163 this.setAttribute( 'class', c ); 164 164 else 165 165 this.removeAttribute( 'class' ); 166 166 } … … 170 170 hasClass : function( className ) 171 171 { 172 172 var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', '' ); 173 return regex.test( this. $.className);173 return regex.test( this.getAttribute('class') ); 174 174 }, 175 175 176 176 /** … … 756 756 * alert( <b>element.hasAttributes()</b> ); "false" 757 757 */ 758 758 hasAttributes : 759 CKEDITOR.env.ie ?759 CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ? 760 760 function() 761 761 { 762 762 var attributes = this.$.attributes; … … 774 774 // outerHTML of the element is not displaying the class attribute. 775 775 // Note : I was not able to reproduce it outside the editor, 776 776 // but I've faced it while working on the TC of #1391. 777 if ( this. $.className.length> 0 )777 if ( this.getAttribute( 'class' ) > 0 ) 778 778 return true; 779 779 780 780 // Attributes to be ignored. … … 877 877 return this; 878 878 }; 879 879 880 if ( CKEDITOR.env.ie && !CKEDITOR.env.ie8)880 if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) 881 881 { 882 882 return function( name, value ) 883 883 { … … 943 943 this.$.removeAttribute( name ); 944 944 }; 945 945 946 if ( CKEDITOR.env.ie && !CKEDITOR.env.ie8)946 if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) 947 947 { 948 948 return function( name ) 949 949 {