From: Moritz Bunkus Date: Mon, 4 Apr 2016 15:10:31 +0000 (+0200) Subject: JS: einige Scope-Fehler gefixt (von jshint) X-Git-Tag: release-3.4.1~255 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=fc53682b03f43e2ab081867ee69e102747dfdf51;p=kivitendo-erp.git JS: einige Scope-Fehler gefixt (von jshint) Variablengültigheit hängt nicht von {} ab, sondern gelten immer für die ganze Funktion. Daher ergibt mehrfachess »var xyz« innerhalb einer Funktion keinen Sinn. --- diff --git a/js/kivi.Order.js b/js/kivi.Order.js index eea906df5..d933def6f 100644 --- a/js/kivi.Order.js +++ b/js/kivi.Order.js @@ -198,17 +198,18 @@ namespace('kivi.Order', function(ns) { kivi.run_once_for('.row_entry', 'on_kbd_click_show_hide', function(elt) { $(elt).keydown(function(event) { + var row; if(event.keyCode == 40 && event.shiftKey == true) { // shift arrow down event.preventDefault(); - var row = $(event.target).parents(".row_entry").first(); + row = $(event.target).parents(".row_entry").first(); $(row).children().not(':first').show(); return false; } if(event.keyCode == 38 && event.shiftKey == true) { // shift arrow up event.preventDefault(); - var row = $(event.target).parents(".row_entry").first(); + row = $(event.target).parents(".row_entry").first(); $(row).children().not(':first').hide(); return false; } diff --git a/js/kivi.js b/js/kivi.js index 6b47e1bf5..58a631a78 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -111,20 +111,21 @@ namespace("kivi", function(ns) { }; ns.t8 = function(text, params) { - var text = ns._locale[text] || text; + text = ns._locale[text] || text; + var key, value if( Object.prototype.toString.call( params ) === '[object Array]' ) { var len = params.length; for(var i=0; i