mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-31 20:10:13 +00:00 
			
		
		
		
	reorganized the inline editor, still needs testing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									241887b614
								
							
						
					
					
						commit
						8519c14c71
					
				
							
								
								
									
										33
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								index.html
									
									
									
									
									
								
							| @ -254,20 +254,35 @@ function setupEditor(){ | |||||||
| 		function(action){ | 		function(action){ | ||||||
| 			if(action == 'on'){ | 			if(action == 'on'){ | ||||||
| 				// make editable fields editable... | 				// make editable fields editable... | ||||||
| 				$('[contenteditable]').attr({contenteditable:"true"}) | 				if(togglePageView('?') == 'on'){ | ||||||
| 				MagazineScroller.stop() | 					toggleInlineEditor('on') | ||||||
|  | 				} | ||||||
| 			} else { | 			} else { | ||||||
| 				$('[contenteditable]').attr({contenteditable:"false"}) | 				toggleInlineEditor('off') | ||||||
| 				MagazineScroller.start() |  | ||||||
| 			} | 			} | ||||||
| 			setCurrentPage($('.current.page')) | 			setCurrentPage($('.current.page')) | ||||||
| 		}) | 		}) | ||||||
|  | 
 | ||||||
|  | 	var toggleInlineEditor = createCSSClassToggler( | ||||||
|  | 		'.chrome', | ||||||
|  | 		'inline-edior', | ||||||
|  | 		function(action){ | ||||||
|  | 			if(action == 'on'){ | ||||||
|  | 				MagazineScroller.stop() | ||||||
|  | 				$('[contenteditable]').attr({contenteditable: 'true'}) | ||||||
|  | 			} else { | ||||||
|  | 				$('[contenteditable]') | ||||||
|  | 					.blur() | ||||||
|  | 					.attr({contenteditable: 'false'}) | ||||||
|  | 				MagazineScroller.start() | ||||||
|  | 			} | ||||||
|  | 		}) | ||||||
| 	 | 	 | ||||||
| 	$('[contenteditable]') | 	$('[contenteditable]') | ||||||
| 		.on('focus', function(){ | 		.on('focus', function(){ | ||||||
| 			if(togglePageView('?') == 'off'){ | 			if(toggleInlineEditor('?') == 'off'){ | ||||||
| 				$(':focus').blur() | 				$(':focus').blur() | ||||||
| 			} else if(toggleEditor('?') == 'on'){ | 			} else { | ||||||
| 				toggleInlineEditorMode('on') | 				toggleInlineEditorMode('on') | ||||||
| 			} | 			} | ||||||
| 		}) | 		}) | ||||||
| @ -296,15 +311,13 @@ function setupEditor(){ | |||||||
| 		.on('fullScreenMode', function(){ | 		.on('fullScreenMode', function(){ | ||||||
| 			$(':focus').blur() | 			$(':focus').blur() | ||||||
| 			if(toggleEditor('?') == 'on'){ | 			if(toggleEditor('?') == 'on'){ | ||||||
| 				toggleInlineEditorMode('on') | 				toggleInlineEditor('on') | ||||||
| 				$('[contenteditable]').attr({contenteditable: 'true'}) |  | ||||||
| 			} | 			} | ||||||
| 		}) | 		}) | ||||||
| 		.on('ribbonMode', function(){ | 		.on('ribbonMode', function(){ | ||||||
| 			$(':focus').blur() | 			$(':focus').blur() | ||||||
| 			if(toggleEditor('?') == 'on'){ | 			if(toggleEditor('?') == 'on'){ | ||||||
| 				toggleInlineEditorMode('off') | 				toggleInlineEditor('off') | ||||||
| 				$('[contenteditable]').attr({contenteditable: 'false'}) |  | ||||||
| 			} | 			} | ||||||
| 		}) | 		}) | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user