mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-31 12:00:11 +00:00 
			
		
		
		
	some more refactoring, preparing to move the editor to editor.js...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									8519c14c71
								
							
						
					
					
						commit
						84f84f9c4f
					
				
							
								
								
									
										23
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								index.html
									
									
									
									
									
								
							| @ -208,6 +208,7 @@ | ||||
| 
 | ||||
| // XXX need better separation between full screen and ribbon modes... | ||||
| function setupEditor(){ | ||||
| 	function setupEditorToolbars(){ | ||||
| 		var indicator = $('<div class="current-page-indicator"/>') | ||||
| 				.appendTo($('.magazine')) | ||||
| 
 | ||||
| @ -243,8 +244,13 @@ function setupEditor(){ | ||||
| 			.appendTo(left_bar) | ||||
| 			.click(function(){ | ||||
| 			}) | ||||
| 	} | ||||
| 	function clearEdiorToolbars(){ | ||||
| 		var indicator = $('.current-page-indicator').remove() | ||||
| 	} | ||||
| 
 | ||||
| 
 | ||||
| 	// general editor mode... | ||||
| 	window.toggleEditor = createCSSClassToggler( | ||||
| 		'.chrome',  | ||||
| 		'editor',  | ||||
| @ -262,10 +268,16 @@ function setupEditor(){ | ||||
| 			} | ||||
| 			setCurrentPage($('.current.page')) | ||||
| 		}) | ||||
| 
 | ||||
| 	var toggleInlineEditor = createCSSClassToggler( | ||||
| 	// inline editor switcher... | ||||
| 	window.toggleInlineEditor = createCSSClassToggler( | ||||
| 		'.chrome', | ||||
| 		'inline-edior', | ||||
| 		function(action){ | ||||
| 			// prevent switching on while not in editor mode... | ||||
| 			if(toggleEditor('?') == 'off' && action == 'on'){ | ||||
| 				return false | ||||
| 			} | ||||
| 		}, | ||||
| 		function(action){ | ||||
| 			if(action == 'on'){ | ||||
| 				MagazineScroller.stop() | ||||
| @ -278,6 +290,7 @@ function setupEditor(){ | ||||
| 			} | ||||
| 		}) | ||||
| 	 | ||||
| 	// editable focus... | ||||
| 	$('[contenteditable]') | ||||
| 		.on('focus', function(){ | ||||
| 			if(toggleInlineEditor('?') == 'off'){ | ||||
| @ -290,9 +303,9 @@ function setupEditor(){ | ||||
| 			toggleInlineEditorMode('off') | ||||
| 		}) | ||||
| 
 | ||||
| 	$('.viewer') | ||||
| 		// move the page indicator... | ||||
| 		// NOTE: this is to be used for page-specific toolbars etc. | ||||
| 	$('.viewer') | ||||
| 		.on('pageChanged', function(){ | ||||
| 			var cur = $('.current.page') | ||||
| 			var indicator = $('.current-page-indicator') | ||||
| @ -307,7 +320,7 @@ function setupEditor(){ | ||||
| 					top: 0, | ||||
| 				}) | ||||
| 		}) | ||||
| 
 | ||||
| 		// switch between editor modes... | ||||
| 		.on('fullScreenMode', function(){ | ||||
| 			$(':focus').blur() | ||||
| 			if(toggleEditor('?') == 'on'){ | ||||
| @ -320,6 +333,8 @@ function setupEditor(){ | ||||
| 				toggleInlineEditor('off') | ||||
| 			} | ||||
| 		}) | ||||
| 
 | ||||
| 	setupEditorToolbars() | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user