mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-01 05:21:32 +08:00 
			
		
		
		
	adhere to convention, prefixing jquery objects with $ and dom not
This commit is contained in:
		
							parent
							
								
									dc35df9f63
								
							
						
					
					
						commit
						6cae68288d
					
				| @ -187,8 +187,8 @@ async function setContentPane() { | |||||||
|              * maxWidth: 100% use full width of container but do not enlarge! |              * maxWidth: 100% use full width of container but do not enlarge! | ||||||
|              * height:auto to ensure that height scales with width |              * height:auto to ensure that height scales with width | ||||||
|              */ |              */ | ||||||
|             const svgHtml = $(svg).css({maxWidth: "100%", height: "auto"}); |             const $svgHtml = $(svg).css({maxWidth: "100%", height: "auto"}); | ||||||
|             $content.html($('<div>').append(svgHtml)); |             $content.html($('<div>').append($svgHtml)); | ||||||
|         } catch(err) { |         } catch(err) { | ||||||
|             console.error("error parsing fullNoteRevision.content as JSON", fullNoteRevision.content, err); |             console.error("error parsing fullNoteRevision.content as JSON", fullNoteRevision.content, err); | ||||||
|             $content.html($("<div>").text("Error parsing content. Please check console.error() for more details.")); |             $content.html($("<div>").text("Error parsing content. Please check console.error() for more details.")); | ||||||
|  | |||||||
| @ -70,7 +70,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget { | |||||||
|         // will be overwritten
 |         // will be overwritten
 | ||||||
|         this.excalidrawRef; |         this.excalidrawRef; | ||||||
|         this.$render; |         this.$render; | ||||||
|         this.$renderElement; |         this.renderElement; | ||||||
|         this.$widget; |         this.$widget; | ||||||
|         this.reactHandlers; // used to control react state
 |         this.reactHandlers; // used to control react state
 | ||||||
|          |          | ||||||
| @ -114,7 +114,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget { | |||||||
|         // this.contentSized();
 |         // this.contentSized();
 | ||||||
|         this.$widget.toggleClass("full-height", true); // only add
 |         this.$widget.toggleClass("full-height", true); // only add
 | ||||||
|         this.$render = this.$widget.find('.canvas-note-render'); |         this.$render = this.$widget.find('.canvas-note-render'); | ||||||
|         this.$renderElement = this.$render.get(0); |         this.renderElement = this.$render.get(0); | ||||||
|         // this.log("doRender", this.$widget);
 |         // this.log("doRender", this.$widget);
 | ||||||
| 
 | 
 | ||||||
|         libraryLoader |         libraryLoader | ||||||
| @ -125,8 +125,8 @@ export default class ExcalidrawTypeWidget extends TypeWidget { | |||||||
|                 const React = window.React; |                 const React = window.React; | ||||||
|                 const ReactDOM = window.ReactDOM; |                 const ReactDOM = window.ReactDOM; | ||||||
|                  |                  | ||||||
|                 ReactDOM.unmountComponentAtNode(this.$renderElement); |                 ReactDOM.unmountComponentAtNode(this.renderElement); | ||||||
|                 ReactDOM.render(React.createElement(this.ExcalidrawReactApp), this.$renderElement); |                 ReactDOM.render(React.createElement(this.ExcalidrawReactApp), this.renderElement); | ||||||
|             }) |             }) | ||||||
| 
 | 
 | ||||||
|         return this.$widget; |         return this.$widget; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom
						Tom