Improving lazing loading. The scrollbars updates itself
This commit is contained in:
@@ -7,6 +7,9 @@ attr_map = {
|
||||
"_id": "id",
|
||||
}
|
||||
|
||||
def safe_attr(attr_name):
|
||||
attr_name = attr_name.replace("hx_", "hx-")
|
||||
return attr_map.get(attr_name, attr_name)
|
||||
|
||||
def to_html(item):
|
||||
if item is None:
|
||||
@@ -31,7 +34,7 @@ class MyFt:
|
||||
|
||||
def to_html(self):
|
||||
body_items = [to_html(item) for item in self.children]
|
||||
return f"<{self.name} {' '.join(f'{attr_map.get(k, k)}="{v}"' for k, v in self.attrs.items())}>{' '.join(body_items)}</div>"
|
||||
return f"<{self.name} {' '.join(f'{safe_attr(k)}="{v}"' for k, v in self.attrs.items())}>{' '.join(body_items)}</div>"
|
||||
|
||||
def __ft__(self):
|
||||
return NotStr(self.to_html())
|
||||
|
||||
Reference in New Issue
Block a user