]> _ Git - Animations.git/commitdiff
wait #5624 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 14 Dec 2022 07:41:33 +0000 (08:41 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 14 Dec 2022 07:41:33 +0000 (08:41 +0100)
Michelin/script.js

index 57afaa8f651b45c95abdc69b737d67032675389f..dfa5e4284ae2155e24367667b19d85ab58f34f72 100644 (file)
@@ -27,6 +27,17 @@ $(function () {
         window.parent.location.hash = "#/page/" + $(this).data('page');
     });
 
+    let existingSearch = getExistingSearch();
+    $.each(existingSearch, function (k, v) {
+        $('[name=' + k).each(function () {
+            if ($(this).is('select')) {
+                $(this).val(v);
+            } else if ($(this).is('input[type=radio]')) {
+                $(this).prop('checked', $(this).attr('value') == v);
+            }
+        });
+    });
+
     $(document).on('change', 'select,input', function () {
         updateForm();
     });
@@ -37,14 +48,19 @@ $(function () {
         return false;
     });
 
-    $(window).on('resize',function(){
-       $("#holder").css('min-height',$(window).outerHeight()-60);
+    $(window).on('resize', function () {
+        $("#holder").css('min-height', $(window).outerHeight() - 60);
     });
 
+
     updateForm();
 
 });
 
+function getExistingSearch() {
+    return parent.fluidbook.cache.get('find_tyre', {});
+}
+
 function valueExists(array, value) {
     var found = false;
     $.each(array, function (k, v) {
@@ -195,7 +211,6 @@ function updateSetForm() {
         var rearList = _tyreForm('rear', 'rear_');
         if (rearList) {
             var res = [];
-            console.log(frontList, rearList);
             $.each(frontList, function (k, v) {
                 var found = false;
                 $.each(rearList, function (kk, vv) {