forked from Botanical/BotanJS
		
	Destruct bug fix
This commit is contained in:
		@@ -23,9 +23,9 @@
 | 
			
		||||
		return null;
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	Heading.prototype.Process = function( key )
 | 
			
		||||
	Heading.prototype.Process = function( content )
 | 
			
		||||
	{
 | 
			
		||||
		this.visualizer.insertSnippet( "heading", { "value": key } );
 | 
			
		||||
		this.visualizer.insertSnippet( "heading", { "size": this.key, "value": content } );
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	Heading.prototype.Retreat = function( sender, e )
 | 
			
		||||
 
 | 
			
		||||
@@ -229,10 +229,14 @@
 | 
			
		||||
 | 
			
		||||
					// Hitting ` twice escapes the ` character itself
 | 
			
		||||
					var v = sender.value.substr( 1 );
 | 
			
		||||
					if( v == "" ) insert = function() { return Dand.textNode( "`" ); };
 | 
			
		||||
 | 
			
		||||
					sender.BindingBox.close( true );
 | 
			
		||||
					if( v == "" )
 | 
			
		||||
					{
 | 
			
		||||
						insert = function() { return Dand.textNode( "`" ); };
 | 
			
		||||
						sender.BindingBox.close( true );
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
					sender.BindingBox.close();
 | 
			
		||||
					// Insert the code snippet with inline flag
 | 
			
		||||
					visualizer.insertSnippet( "code", { "inline": "on", "lang": "plain", "value": v } );
 | 
			
		||||
					break;
 | 
			
		||||
@@ -245,6 +249,7 @@
 | 
			
		||||
					if( ModLevels.Cands().Empty && 1 < ModLevels.length )
 | 
			
		||||
					{
 | 
			
		||||
						ModLevels.Action()( sender.value );
 | 
			
		||||
						sender.BindingBox.close();
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
@@ -355,13 +360,16 @@
 | 
			
		||||
 | 
			
		||||
		var ClosePanel = function( confirmed )
 | 
			
		||||
		{
 | 
			
		||||
			Cycle.next( function() { _self.Present = false; } );
 | 
			
		||||
			visualizer.restoreSelection();
 | 
			
		||||
 | 
			
		||||
			if( confirmed && insert != undefined )
 | 
			
		||||
				visualizer.insertAtCaret( insert() );
 | 
			
		||||
 | 
			
		||||
			destructor.Destruct();
 | 
			
		||||
			// Posponing this prevents the BackQuoteBinding firing
 | 
			
		||||
			Cycle.next( function() {
 | 
			
		||||
				_self.Present = false;
 | 
			
		||||
				destructor.Destruct();
 | 
			
		||||
			} );
 | 
			
		||||
		};
 | 
			
		||||
 | 
			
		||||
		// Advance the input level by CandidateAction
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user