Skip to content

Commit

Permalink
Fixed jshint suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelczak authored and pawelczak committed Oct 29, 2015
1 parent 91bd746 commit 8311e19
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 25 deletions.
22 changes: 10 additions & 12 deletions dist/jquery.easy-autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ var EasyAutocomplete = (function(scope){

this.printPropertiesThatDoesntExist = function(consol, optionsToCheck) {
printPropertiesThatDoesntExist(consol, optionsToCheck);
}
};


prepareDefaults();
Expand Down Expand Up @@ -258,7 +258,7 @@ var EasyAutocomplete = (function(scope){
}

/* If data is an object */
if (target.data !== undefined && target.data !== null && typeof target.data == "object") {
if (target.data !== undefined && target.data !== null && typeof target.data === "object") {
mergedObject.data = target.data;
}

Expand Down Expand Up @@ -827,7 +827,7 @@ var EasyAutocomplete = (function(scope){

return genericTemplates.basic.method;

}
},


prepareBuildMethod = function(options) {
Expand Down Expand Up @@ -855,9 +855,9 @@ var EasyAutocomplete = (function(scope){
}

if (options.type && genericTemplates[options.type]) {
return (function (){
return (function () {
var _cssClass = genericTemplates[options.type].cssClass;
return function() { return _cssClass;}
return function() { return _cssClass;};
})();
} else {
return emptyStringFunction;
Expand All @@ -870,7 +870,7 @@ var EasyAutocomplete = (function(scope){
this.build = prepareBuildMethod(options);


}
};

return scope;

Expand All @@ -896,7 +896,6 @@ var EasyAutocomplete = (function(scope) {
logger = new scope.Logger(),
template = new scope.Template(options.template),
listBuilderService = new scope.ListBuilderService(config, scope.proccess),
proccessResponseData = scope.proccess,
checkParam = config.equals,

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

})
.on("selectElement", function(event, selected) {
.on("selectElement", function() {
$elements_container.find("ul li").removeClass("selected");
$elements_container.find("ul li").eq(selectedElement).addClass("selected");

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


var $item = "",
$list = $("<ul>"),
$listContainer = $elements_container.find("ul");

$listContainer
Expand Down Expand Up @@ -1380,10 +1378,10 @@ var EasyAutocomplete = (function(scope) {

function createAjaxSettings() {

var settings = new Object(),
var settings = {},
ajaxSettings = config.get("ajaxSettings") || {};

for (set in ajaxSettings) {
for (var set in ajaxSettings) {
settings[set] = ajaxSettings[set];
}

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

if (config.get("matchResponseProperty") !== false) {
if (typeof config.get("matchResponseProperty") === "string") {
return (data[config.get("matchResponseProperty")] == inputPhrase);
return (data[config.get("matchResponseProperty")] === inputPhrase);
}

if (typeof config.get("matchResponseProperty") === "function") {
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.easy-autocomplete.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ var EasyAutocomplete = (function(scope){

this.printPropertiesThatDoesntExist = function(consol, optionsToCheck) {
printPropertiesThatDoesntExist(consol, optionsToCheck);
}
};


prepareDefaults();
Expand Down Expand Up @@ -267,7 +267,7 @@ var EasyAutocomplete = (function(scope){
}

/* If data is an object */
if (target.data !== undefined && target.data !== null && typeof target.data == "object") {
if (target.data !== undefined && target.data !== null && typeof target.data === "object") {
mergedObject.data = target.data;
}

Expand Down
10 changes: 4 additions & 6 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ var EasyAutocomplete = (function(scope) {
logger = new scope.Logger(),
template = new scope.Template(options.template),
listBuilderService = new scope.ListBuilderService(config, scope.proccess),
proccessResponseData = scope.proccess,
checkParam = config.equals,

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

})
.on("selectElement", function(event, selected) {
.on("selectElement", function() {
$elements_container.find("ul li").removeClass("selected");
$elements_container.find("ul li").eq(selectedElement).addClass("selected");

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


var $item = "",
$list = $("<ul>"),
$listContainer = $elements_container.find("ul");

$listContainer
Expand Down Expand Up @@ -554,10 +552,10 @@ var EasyAutocomplete = (function(scope) {

function createAjaxSettings() {

var settings = new Object(),
var settings = {},
ajaxSettings = config.get("ajaxSettings") || {};

for (set in ajaxSettings) {
for (var set in ajaxSettings) {
settings[set] = ajaxSettings[set];
}

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

if (config.get("matchResponseProperty") !== false) {
if (typeof config.get("matchResponseProperty") === "string") {
return (data[config.get("matchResponseProperty")] == inputPhrase);
return (data[config.get("matchResponseProperty")] === inputPhrase);
}

if (typeof config.get("matchResponseProperty") === "function") {
Expand Down
8 changes: 4 additions & 4 deletions src/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ var EasyAutocomplete = (function(scope){

return genericTemplates.basic.method;

}
},


prepareBuildMethod = function(options) {
Expand Down Expand Up @@ -174,9 +174,9 @@ var EasyAutocomplete = (function(scope){
//client template type

if (options.type && genericTemplates[options.type]) {
return (function (){
return (function () {
var _cssClass = genericTemplates[options.type].cssClass;
return function() { return _cssClass;}
return function() { return _cssClass;};
})();
} else {
return emptyStringFunction;
Expand All @@ -189,7 +189,7 @@ var EasyAutocomplete = (function(scope){
this.build = prepareBuildMethod(options);


}
};

return scope;

Expand Down

0 comments on commit 8311e19

Please sign in to comment.