Guest User

Untitled

a guest
Jan 29th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             var txt = "";
  2.             var currentList = "";
  3.             var colorIndex = colorListBlock.index(colorBlock.find("li.active"));
  4.             $(productsList).each(function(k){
  5.                 if(parseInt(this.posts) === 5) {
  6.                     return;
  7.                 }
  8.                 var isAdd = false;
  9.                 // noinspection EqualityComparisonWithCoercionJS
  10.                 if (cnt > 0) {
  11.                     if(parseInt(this.posts) === cnt + 1) {
  12.                         currentList += '<option value="' + k + '">' + this.product + '</option>';
  13.                     }
  14.                 }else{
  15.                     // noinspection EqualityComparisonWithCoercionJS
  16.                     if(parseInt(this.posts) < 2 && parseInt(this.color) === parseInt(colorIndex)){
  17.                         currentList += '<option value="' + k + '" data-posts="'+this.posts+'" data-img="'+this.image+'">' + this.product + '</option>';
  18.                     }
  19.                 }
  20.             });
  21.  
  22.  
  23.             if(cnt === 0) {
  24.                 txt = "КОНФИГУРАЦИЯ МОДУЛЯ " + (noIndex + 1);
  25.  
  26.                 configBlock.append("<div class='post-config'>" +
  27.                     "<div class='name'>"+txt+"</div>" +
  28.                     "<select class='module module-first' data-module='0'>" +
  29.                         "<option value='' class='default-value'>Выберите механизм 1</option>" + currentList +
  30.                     "</select>" +
  31.                     "<select class='module module-second'  data-module='1'>" +
  32.                         "<option value='' class='default-value'>Выберите механизм 2</option>" + currentList +
  33.                     "</select>" +
  34.                     "</div>")
  35.             }else {
  36.                 txt = "КОНФИГУРАЦИЯ ВЫКЛЮЧАТЕЛЯ " + (noIndex + 1);
  37.  
  38.                 configBlock.append("<div class='post-config'><div class='name'>"+txt+"</div><select class='zone'><option value=''>Выберите механизм</option> " + currentList +" </select></div>")
  39.             }
  40.         });
Add Comment
Please, Sign In to add comment