Skip to content

Commit 8311e19

Browse files
pawelczakpawelczak
authored andcommitted
Fixed jshint suggestions
1 parent 91bd746 commit 8311e19

File tree

5 files changed

+21
-25
lines changed

5 files changed

+21
-25
lines changed

dist/jquery.easy-autocomplete.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ var EasyAutocomplete = (function(scope){
153153

154154
this.printPropertiesThatDoesntExist = function(consol, optionsToCheck) {
155155
printPropertiesThatDoesntExist(consol, optionsToCheck);
156-
}
156+
};
157157

158158

159159
prepareDefaults();
@@ -258,7 +258,7 @@ var EasyAutocomplete = (function(scope){
258258
}
259259

260260
/* If data is an object */
261-
if (target.data !== undefined && target.data !== null && typeof target.data == "object") {
261+
if (target.data !== undefined && target.data !== null && typeof target.data === "object") {
262262
mergedObject.data = target.data;
263263
}
264264

@@ -827,7 +827,7 @@ var EasyAutocomplete = (function(scope){
827827

828828
return genericTemplates.basic.method;
829829

830-
}
830+
},
831831

832832

833833
prepareBuildMethod = function(options) {
@@ -855,9 +855,9 @@ var EasyAutocomplete = (function(scope){
855855
}
856856

857857
if (options.type && genericTemplates[options.type]) {
858-
return (function (){
858+
return (function () {
859859
var _cssClass = genericTemplates[options.type].cssClass;
860-
return function() { return _cssClass;}
860+
return function() { return _cssClass;};
861861
})();
862862
} else {
863863
return emptyStringFunction;
@@ -870,7 +870,7 @@ var EasyAutocomplete = (function(scope){
870870
this.build = prepareBuildMethod(options);
871871

872872

873-
}
873+
};
874874

875875
return scope;
876876

@@ -896,7 +896,6 @@ var EasyAutocomplete = (function(scope) {
896896
logger = new scope.Logger(),
897897
template = new scope.Template(options.template),
898898
listBuilderService = new scope.ListBuilderService(config, scope.proccess),
899-
proccessResponseData = scope.proccess,
900899
checkParam = config.equals,
901900

902901
$field = $input,
@@ -1085,7 +1084,7 @@ var EasyAutocomplete = (function(scope) {
10851084
config.get("list").onHideListEvent();
10861085

10871086
})
1088-
.on("selectElement", function(event, selected) {
1087+
.on("selectElement", function() {
10891088
$elements_container.find("ul li").removeClass("selected");
10901089
$elements_container.find("ul li").eq(selectedElement).addClass("selected");
10911090

@@ -1095,7 +1094,6 @@ var EasyAutocomplete = (function(scope) {
10951094

10961095

10971096
var $item = "",
1098-
$list = $("<ul>"),
10991097
$listContainer = $elements_container.find("ul");
11001098

11011099
$listContainer
@@ -1380,10 +1378,10 @@ var EasyAutocomplete = (function(scope) {
13801378

13811379
function createAjaxSettings() {
13821380

1383-
var settings = new Object(),
1381+
var settings = {},
13841382
ajaxSettings = config.get("ajaxSettings") || {};
13851383

1386-
for (set in ajaxSettings) {
1384+
for (var set in ajaxSettings) {
13871385
settings[set] = ajaxSettings[set];
13881386
}
13891387

@@ -1394,7 +1392,7 @@ var EasyAutocomplete = (function(scope) {
13941392

13951393
if (config.get("matchResponseProperty") !== false) {
13961394
if (typeof config.get("matchResponseProperty") === "string") {
1397-
return (data[config.get("matchResponseProperty")] == inputPhrase);
1395+
return (data[config.get("matchResponseProperty")] === inputPhrase);
13981396
}
13991397

14001398
if (typeof config.get("matchResponseProperty") === "function") {

dist/jquery.easy-autocomplete.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/configuration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ var EasyAutocomplete = (function(scope){
149149

150150
this.printPropertiesThatDoesntExist = function(consol, optionsToCheck) {
151151
printPropertiesThatDoesntExist(consol, optionsToCheck);
152-
}
152+
};
153153

154154

155155
prepareDefaults();
@@ -267,7 +267,7 @@ var EasyAutocomplete = (function(scope){
267267
}
268268

269269
/* If data is an object */
270-
if (target.data !== undefined && target.data !== null && typeof target.data == "object") {
270+
if (target.data !== undefined && target.data !== null && typeof target.data === "object") {
271271
mergedObject.data = target.data;
272272
}
273273

src/core.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ var EasyAutocomplete = (function(scope) {
1717
logger = new scope.Logger(),
1818
template = new scope.Template(options.template),
1919
listBuilderService = new scope.ListBuilderService(config, scope.proccess),
20-
proccessResponseData = scope.proccess,
2120
checkParam = config.equals,
2221

2322
$field = $input,
@@ -231,7 +230,7 @@ var EasyAutocomplete = (function(scope) {
231230
config.get("list").onHideListEvent();
232231

233232
})
234-
.on("selectElement", function(event, selected) {
233+
.on("selectElement", function() {
235234
$elements_container.find("ul li").removeClass("selected");
236235
$elements_container.find("ul li").eq(selectedElement).addClass("selected");
237236

@@ -241,7 +240,6 @@ var EasyAutocomplete = (function(scope) {
241240

242241

243242
var $item = "",
244-
$list = $("<ul>"),
245243
$listContainer = $elements_container.find("ul");
246244

247245
$listContainer
@@ -554,10 +552,10 @@ var EasyAutocomplete = (function(scope) {
554552

555553
function createAjaxSettings() {
556554

557-
var settings = new Object(),
555+
var settings = {},
558556
ajaxSettings = config.get("ajaxSettings") || {};
559557

560-
for (set in ajaxSettings) {
558+
for (var set in ajaxSettings) {
561559
settings[set] = ajaxSettings[set];
562560
}
563561

@@ -568,7 +566,7 @@ var EasyAutocomplete = (function(scope) {
568566

569567
if (config.get("matchResponseProperty") !== false) {
570568
if (typeof config.get("matchResponseProperty") === "string") {
571-
return (data[config.get("matchResponseProperty")] == inputPhrase);
569+
return (data[config.get("matchResponseProperty")] === inputPhrase);
572570
}
573571

574572
if (typeof config.get("matchResponseProperty") === "function") {

src/template.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ var EasyAutocomplete = (function(scope){
137137

138138
return genericTemplates.basic.method;
139139

140-
}
140+
},
141141

142142

143143
prepareBuildMethod = function(options) {
@@ -174,9 +174,9 @@ var EasyAutocomplete = (function(scope){
174174
//client template type
175175

176176
if (options.type && genericTemplates[options.type]) {
177-
return (function (){
177+
return (function () {
178178
var _cssClass = genericTemplates[options.type].cssClass;
179-
return function() { return _cssClass;}
179+
return function() { return _cssClass;};
180180
})();
181181
} else {
182182
return emptyStringFunction;
@@ -189,7 +189,7 @@ var EasyAutocomplete = (function(scope){
189189
this.build = prepareBuildMethod(options);
190190

191191

192-
}
192+
};
193193

194194
return scope;
195195

0 commit comments

Comments
 (0)