-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import { Controller } from "@hotwired/stimulus"; | ||
Check failure on line 1 in app/javascript/js/controllers/has_many_refresh_controller.js
|
||
|
||
export default class extends Controller { | ||
connect() { | ||
console.log("Heeere!!!"); | ||
static values = { | ||
turboFrameId: String, | ||
}; | ||
|
||
refresh() { | ||
var element = document.getElementById(this.turboFrameIdValue); | ||
Check failure on line 9 in app/javascript/js/controllers/has_many_refresh_controller.js
|
||
if (element) { | ||
element.reload(); | ||
Check failure on line 11 in app/javascript/js/controllers/has_many_refresh_controller.js
|
||
} else { | ||
console.error( | ||
Check warning on line 13 in app/javascript/js/controllers/has_many_refresh_controller.js
|
||
"Element with ID '" + this.turboFrameIdValue + "' not found." | ||
Check failure on line 14 in app/javascript/js/controllers/has_many_refresh_controller.js
|
||
); | ||
Check failure on line 15 in app/javascript/js/controllers/has_many_refresh_controller.js
|
||
} | ||
} | ||
} |