Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Inefficient jQuery usage

Peter van der Does6b1d50fa4706
diff --git a/wger/manager/templates/schedule/view.html b/wger/manager/templates/schedule/view.html
index d3edf40b5..b614dbd6f 100644
--- a/wger/manager/templates/schedule/view.html
+++ b/wger/manager/templates/schedule/view.html
@@ -17,7 +17,7 @@
<script type="text/javascript">
function init_sortable()
{
- $("#schedule-table tbody").off();
+ $("#schedule-table").find("tbody").off();
var elements = document.getElementsByTagName('tbody');
$.each(elements, function(index, element) {
Sortable.create(element, {
diff --git a/wger/manager/templates/workout/timer.html b/wger/manager/templates/workout/timer.html
index cb7ff9f85..15f06c61f 100644
--- a/wger/manager/templates/workout/timer.html
+++ b/wger/manager/templates/workout/timer.html
@@ -135,7 +135,7 @@ $(document).ready(function() {
$('.timer-step').height(div_height);
//wrap into mother div
- $('#timer-container ul').wrap('<div id="mother" />');
+ $('#timer-container').find('ul').wrap('<div id="mother" />');
//assign height width and overflow hidden to mother
$('#mother').css({
@@ -151,7 +151,7 @@ $(document).ready(function() {
//get total of image sizes and set as width for ul
var totalWidth = $('.timer-step').length * div_width;
- $('#timer-container ul').css({
+ $('#timer-container').find('ul').css({
width: function() {
return totalWidth;
}
@@ -181,7 +181,7 @@ $(document).ready(function() {
});
// Bind the pagination buttons
- $('#timer-container ul li.timer-step a.next').bind("click", function(e) {
+ $('#timer-container').find('ul li.timer-step a.next').bind("click", function(e) {
e.preventDefault();
var step_id = $(this).parents('li').data('step');
var step_time = $(this).parents('li').data('time');