Ticket #5307: 5307_2.patch
File 5307_2.patch, 2.2 KB (added by , 14 years ago) |
---|
-
_source/plugins/dialog/plugin.js
335 335 336 336 processed = 1; 337 337 } 338 else if ( keystroke == CKEDITOR.ALT + 121 && !me._.tabBarMode )338 else if ( keystroke == CKEDITOR.ALT + 121 && !me._.tabBarMode && me.getPageCount() > 1 ) 339 339 { 340 340 // Alt-F10 puts focus into the current tab item in the tab bar. 341 341 me._.tabBarMode = true; … … 893 893 894 894 page.setAttribute( 'aria-labelledby', tabId ); 895 895 896 // If only a single page exist, a different style is used in the central pane.897 if ( this._.pageCount === 0 )898 this.parts.dialog.addClass( 'cke_single_page' );899 else900 this.parts.dialog.removeClass( 'cke_single_page' );901 902 896 // Take records for the tabs and elements created. 903 897 this._.tabs[ contents.id ] = [ tab, page ]; 904 898 this._.tabIdList.push( contents.id ); 905 this._.pageCount++;899 !contents.hidden && this._.pageCount++; 906 900 this._.lastTab = tab; 901 this.updateStyle(); 907 902 908 903 var contentMap = this._.contents[ contents.id ] = {}, 909 904 cursor, … … 961 956 this._.currentTabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, id ); 962 957 }, 963 958 959 // Dialog state-specific style updates. 960 updateStyle : function() 961 { 962 // If only a single page shown, a different style is used in the central pane. 963 this.parts.dialog[ ( this._.pageCount === 1 ? 'add' : 'remove' ) + 'Class' ]( 'cke_single_page' ); 964 }, 965 964 966 /** 965 967 * Hides a page's tab away from the dialog. 966 968 * @param {String} id The page's Id. … … 970 972 hidePage : function( id ) 971 973 { 972 974 var tab = this._.tabs[id] && this._.tabs[id][0]; 973 if ( !tab )975 if ( !tab || this._.pageCount == 1 ) 974 976 return; 977 // Switch to other tab first when we're hiding the active tab. 978 else if ( id == this._.currentTabId ) 979 this.selectPage( getPreviousVisibleTab.call( this ) ); 980 975 981 tab.hide(); 982 this._.pageCount--; 983 this.updateStyle(); 976 984 }, 977 985 978 986 /** … … 987 995 if ( !tab ) 988 996 return; 989 997 tab.show(); 998 this._.pageCount++; 999 this.updateStyle(); 990 1000 }, 991 1001 992 1002 /**