From: Moritz Bunkus Date: Thu, 12 Jan 2017 09:27:22 +0000 (+0100) Subject: PartPicker: Strict-Modus & Warnungen von jshint beseitigt X-Git-Tag: release-3.5.4~1735 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5debedf3465f0a66af252c65b1c7b7e694fbada6;p=kivitendo-erp.git PartPicker: Strict-Modus & Warnungen von jshint beseitigt --- diff --git a/js/autocomplete_part.js b/js/autocomplete_part.js index cbce72cea..4c0442c63 100644 --- a/js/autocomplete_part.js +++ b/js/autocomplete_part.js @@ -1,4 +1,6 @@ namespace('kivi', function(k){ + "use strict"; + k.PartPicker = function($real, options) { // short circuit in case someone double inits us if ($real.data("part_picker")) @@ -109,7 +111,7 @@ namespace('kivi', function(k){ if (state == STATES.PICKED) { annotate_state(); return true - } else if (state == STATES.UNDEFINED && $dummy.val() == '') + } else if (state == STATES.UNDEFINED && $dummy.val() === '') set_item({}) else { last_unverified_dummy = $dummy.val(); @@ -121,7 +123,7 @@ namespace('kivi', function(k){ function annotate_state () { if (state == STATES.PICKED) $dummy.removeClass(STATES.UNDEFINED).addClass(STATES.PICKED); - else if (state == STATES.UNDEFINED && $dummy.val() == '') + else if (state == STATES.UNDEFINED && $dummy.val() === '') $dummy.removeClass(STATES.UNDEFINED).addClass(STATES.PICKED); else { last_unverified_dummy = $dummy.val(); @@ -137,7 +139,7 @@ namespace('kivi', function(k){ }, ajax_data(function(){ var val = $('#part_picker_filter').val(); return val === undefined ? '' : val })), success: function(data){ $('#part_picker_result').html(data) } }); - }; + } function result_timer (event) { if (!$('no_paginate').prop('checked')) { @@ -156,7 +158,7 @@ namespace('kivi', function(k){ function close_popup() { $('#part_selection').dialog('close'); - }; + } function handle_changed_text(callbacks) { $.ajax({ @@ -177,7 +179,7 @@ namespace('kivi', function(k){ annotate_state(); } }); - }; + } $dummy.autocomplete({ source: function(req, rsp) { @@ -207,7 +209,7 @@ namespace('kivi', function(k){ $dummy.keydown(function(event){ if (event.which == KEY.ENTER || event.which == KEY.TAB) { // if string is empty assume they want to delete - if ($dummy.val() == '') { + if ($dummy.val() === '') { set_item({}); return true; } else if (state == STATES.PICKED) {