Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 891d4ce8

Von Sven Schöling vor fast 8 Jahren hinzugefügt

  • ID 891d4ce8b577101d83026aa5c54fd3879df6215a
  • Vorgänger 8d2096c2
  • Nachfolger 5aec18fe

kivi.Part.js: jslint und use strict

Unterschiede anzeigen:

js/kivi.Part.js
1 1
namespace('kivi.Part', function(ns) {
2
  'use strict';
2 3

  
3 4
  ns.open_history_popup = function() {
4 5
    var id = $("#part_id").val();
......
52 53
    } else if ( part_type === 'assembly') {
53 54
      $('#assembly thead a img').remove();
54 55
      data = $('#assembly :input').serializeArray();
55
    };
56
    }
56 57

  
57 58
    var src;
58 59
    if (dir == "1") {
......
122 123
      rows = $('.assortment_item_row [name="position"]');
123 124
    } else if ( part_type === 'assembly') {
124 125
      rows = $('.assembly_item_row [name="position"]');
125
    };
126
    }
126 127
    $(rows).each(function(idx, elt) {
127 128
      $(elt).html(idx+1);
128 129
      var row = $(elt).closest('tr');
......
130 131
        if ( row.hasClass('listrow1') ) {
131 132
          row.removeClass('listrow1');
132 133
          row.addClass('listrow0');
133
        };
134
        }
134 135
      } else {
135 136
        if ( row.hasClass('listrow0') ) {
136 137
          row.removeClass('listrow0');
137 138
          row.addClass('listrow1');
138
        };
139
      };
139
        }
140
      }
140 141
    });
141 142
  };
142 143

  
......
149 150
      ns.assortment_recalc();
150 151
    } else if ( part_type === 'assembly') {
151 152
      ns.assembly_recalc();
152
    };
153
    }
153 154
  };
154 155

  
155 156
  ns.add_assortment_item = function() {
......
183 184
      old_rows = $('.assortment_item_row').detach();
184 185
    } else if ( part_type === 'assembly') {
185 186
      old_rows = $('.assembly_item_row').detach();
186
    };
187
    }
187 188
    var new_rows = [];
188 189
    $(data).each(function(idx, elt) {
189 190
      new_rows.push(old_rows[elt.old_pos - 1]);
......
192 193
      $(new_rows).appendTo($('#assortment_items'));
193 194
    } else if ( part_type === 'assembly') {
194 195
      $(new_rows).appendTo($('#assembly_items'));
195
    };
196
    }
196 197
    ns.renumber_positions();
197 198
  };
198 199

  
......
275 276
    $('.add_assortment_item_input').keydown(function(event) {
276 277
      if(event.keyCode == 13) {
277 278
        event.preventDefault();
278
        if ($("input[name='add_items[+].parts_id']").val() != '' ) {
279
        if ($("input[name='add_items[+].parts_id']").val() !== '' ) {
279 280
          kivi.Part.show_multi_items_dialog("assortment");
280 281
         // ns.add_assortment_item();
281
        };
282
        }
282 283
        return false;
283 284
      }
284 285
    });
......
286 287
    $('.add_assembly_item_input').keydown(function(event) {
287 288
      if(event.keyCode == 13) {
288 289
        event.preventDefault();
289
        if ($("input[name='add_items[+].parts_id']").val() != '' ) {
290
        if ($("input[name='add_items[+].parts_id']").val() !== '' ) {
290 291
          kivi.Part.show_multi_items_dialog("assortment");
291 292
          // ns.add_assembly_item();
292 293
        }

Auch abrufbar als: Unified diff