Changeset 2105 for FCKeditor/branches
- Timestamp:
- 2008-06-23 11:16:35 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/features/div_container/editor/dialog/fck_div.html
r2104 r2105 69 69 } 70 70 71 function GetNearestAncestorDirection( node ) 72 { 73 var dir = 'ltr' ; // HTML default. 74 while ( ( node = node.parentNode ) ) 75 { 76 if ( node.dir ) 77 dir = node.dir ; 78 } 79 return dir ; 80 } 81 71 82 window.onload = function() 72 83 { … … 97 108 GetE( 'selStyle' ).value = i ; 98 109 110 // Set the value for other inputs 99 111 if ( ActiveEl ) 100 112 { … … 104 116 GetE( 'txtInlineStyle').value = ActiveEl.getAttribute( 'style' ) ; 105 117 GetE( 'txtTitle' ).value = ActiveEl.title ; 106 GetE( 'selLangDir').value = ActiveEl.dir ;118 GetE( 'selLangDir').value = ActiveEl.dir || GetNearestAncestorDirection( ActiveEl ) ; 107 119 } 108 120 } … … 128 140 } 129 141 142 // Apply modifications to the DIV container according to dialog inputs. 130 143 setValue( 'class', 'txtClass' ) ; 131 144 setValue( 'id', 'txtId' ) ; … … 136 149 setValue( 'style', 'txtInlineStyle' ) ; 137 150 setValue( 'title', 'txtTitle' ) ; 138 setValue( 'dir', 'selLangDir' ) ; 151 var dir = GetE( 'selLangDir' ).value ; 152 if ( GetNearestAncestorDirection( ActiveEl ) != dir ) 153 ActiveEl.dir = dir ; 154 else 155 ActiveEl.removeAttribute( 'dir' ) ; 139 156 140 157 var styleName = GetE( 'selStyle' ).value ;