Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Remove JS for exercise search, this is done with a filtered listview

Roland Geider539eb7d1ccbc
diff --git a/wger/exercises/templates/mobile/overview.html b/wger/exercises/templates/mobile/overview.html
index 63a74b246..255dd9f7f 100644
--- a/wger/exercises/templates/mobile/overview.html
+++ b/wger/exercises/templates/mobile/overview.html
@@ -8,47 +8,11 @@
{% block title %}{% trans "Exercises" %}{% endblock %}
-
-{% block header %}
-<script>
-$( document ).on( "pageinit", "#myPage", function() {
-$( "#exercise_search_form" ).on( "listviewbeforefilter", function ( e, data ) {
- var $ul = $( this ),
- $input = $( data.input ),
- value = $input.val(),
- html = "";
- $ul.html( "" );
- if ( value && value.length > 2 ) {
- $ul.html( "<li><div class='ui-loader'><span class='ui-icon ui-icon-loading'></span></div></li>" );
- $ul.listview( "refresh" );
- $.ajax({
- url: "{% url 'wger.exercises.views.exercises.search' %}",
- dataType: "json",
- data: {
- q: $input.val()
- }
- })
- .then( function ( response ) {
- $.each( response, function ( i, val ) {
- html += '<li><a href="/exercise/' + val.id + '/view/">' + val.name + '</a></li>';
- });
- $ul.html( html );
- $ul.listview( "refresh" );
- $ul.trigger( "updatelayout");
- });
- }
- });
-});
-</script>
-{% endblock %}
-
-
<!--
Main Content
-->
{% block content %}
-
<div data-role="collapsible-set" data-theme="c" data-content-theme="c">
{% for category in categories %}
<div data-role="collapsible">