Skip to content

Commit 1065939

Browse files
committed
Implement removing of a template in plain javascript
1 parent cae10eb commit 1065939

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/widget.coffee

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class window.JsWidget.Widget
4141
# Removes the html from the DOM, if the widget already exists
4242
remove_widget_if_existing: ->
4343
if window.JsWidget.JQUERY and $("##{@id}").length > 0
44-
$("##{@id}").detach() # TODO: Check for correct method to remove an element
45-
true
46-
# TODO: Implement else branch
44+
$("##{@id}").detach()
45+
else
46+
document.getElementById(@id).remove()
4747

4848
# Load a template file from the given path via ajax
4949
load_template_file: (path, callback) ->

0 commit comments

Comments
 (0)