Changeset - cb7556869244
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 3 years ago 2022-05-31 06:18:58
drewp@bigasterisk.com
ResourceDisplay ignore more patches
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light9/web/ResourceDisplay.ts
Show inline comments
 
@@ -106,28 +106,33 @@ export class ResourceDisplay extends Lit
 
      if (!this.graph) {
 
        return; /*too soon*/
 
      }
 
      this.runUriHandler();
 
    }
 
  }
 

	
 
  resClasses() {
 
    return this.minor ? "resource minor" : "resource";
 
  }
 

	
 
  runUriHandler() {
 

	
 
    this.graph.runHandler(this.onUri.bind(this), `rdisplay ${this.href()}` /*needs uniqueness?*/);
 
  }
 

	
 
  onUri(patch?: Patch) {
 
    if (patch && !patchContainsPreds(patch, [this.graph.Uri("rdfs:label")])) {
 
      return;
 
    }
 

	
 
    if (!this.uri) {
 
      this.label = "<no uri>";
 
      return;
 
    }
 

	
 
    const uri = this.realUri();
 
    this.graph.runHandler(this.setLabel.bind(this), `label ${uri.value}`);
 
  }
 

	
 
  setLabel(patch?: Patch) {
 
    if (patch && !patchContainsPreds(patch, [RDFS_LABEL])) {
 
      return;
0 comments (0 inline, 0 general)