Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions classes/mapworker.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ public function process_map_objects(): void {
} else {
$this->svgmap->set_hidden($links[$place]);
$this->svgmap->remove_link($links[$place]);
$this->svgmap->remove_place_or_path($place);
$this->svgmap->remove_attribute($place['linkId'], 'data-cmid');
}
}
// Remove all places that are impossible to reach.
Expand Down
14 changes: 14 additions & 0 deletions classes/svgmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,20 @@ public function set_attribute(string $id, string $attribute, string $value): voi
}
}

/**
* Removes an attribute of an element.
*
* @param string $id The id of the DOM element
* @param string $attribute The name of the attribute
* @return void
*/
public function remove_attribute(string $id, string $attribute): void {
$element = $this->get_element_by_id($id);
if ($element) {
$element->removeAttribute($attribute);
}
}

/**
* Replaces all CDATA sections with properly escaped content
*
Expand Down
Loading