isudatateam / datateam

Prefer var declarations be placed at the top of their scope JS-0102
Anti-pattern
Minor
3 months ago3 months old
All 'var' declarations must be at the top of the function scope
174	    window.location.hash = e.target.hash.replace("#", "#" + prefix);
175	})
176	// Read any hash links
177	var hash = document.location.hash;178	if (hash) {
179		$('.nav-tabs a[href="'+hash.replace(prefix,"")+'"]').tab('show');
180	}
All 'var' declarations must be at the top of the function scope
169	});
170	// https://stackoverflow.com/questions/7862233
171	// Change hash for page-reload
172	var prefix = "tab_";173	$('.nav-tabs.maintabs a').on('shown.bs.tab', function (e) {
174	    window.location.hash = e.target.hash.replace("#", "#" + prefix);
175	})
All 'var' declarations must be at the top of the function scope
142
143		var currentdiv = TABS[CURRENTTAB] +"-ui";
144		$("#"+currentdiv).css("display", "block");
145		var btndiv = TABS[CURRENTTAB] +"-btn";146		$("#"+btndiv).removeClass().addClass("btn btn-primary");
147
148		$('#next-btn').prop('disabled', ((CURRENTTAB + 1) == TABS.length));
All 'var' declarations must be at the top of the function scope
140		$("#"+btndiv).removeClass().addClass("btn btn-default");
141		CURRENTTAB = TABS.indexOf(tabtitle);
142
143		var currentdiv = TABS[CURRENTTAB] +"-ui";144		$("#"+currentdiv).css("display", "block");
145		var btndiv = TABS[CURRENTTAB] +"-btn";
146		$("#"+btndiv).removeClass().addClass("btn btn-primary");
All 'var' declarations must be at the top of the function scope
136		var tabtitle = $(this).attr("id").replace("-btn", "");
137		var currentdiv = TABS[CURRENTTAB] +"-ui";
138		$("#"+currentdiv).css("display", "none");
139		var btndiv = TABS[CURRENTTAB] +"-btn";140		$("#"+btndiv).removeClass().addClass("btn btn-default");
141		CURRENTTAB = TABS.indexOf(tabtitle);
142