Skip to content

Commit 4d80d30

Browse files
committed
remove view getting called by default in the api
1 parent fcc0dd5 commit 4d80d30

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

unbxdSearch.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,17 +1213,19 @@ var unbxdSearchInit = function(jQuery, Handlebars){
12131213
,ranges : {}
12141214
,categoryId : ""
12151215
,extra : {
1216-
format : "json"
1217-
,page : 1
1218-
,rows : 12
1219-
,view : ( this.options.viewTypes !== undefined && this.options.viewTypes.length > 0 ? this.options.viewTypes[0] : "")
1216+
format: "json"
1217+
,page: 1
1218+
,rows: 12
12201219
}
12211220
};
12221221

1223-
if(typeof this.options.customReset == "function")
1224-
this.options.customReset.call(this);
1222+
if( this.options.viewTypes && this.options.viewTypes.length > 0)
1223+
this.params.extra.view = this.options.viewTypes[0];
12251224

1226-
return this;
1225+
if(typeof this.options.customReset == "function")
1226+
this.options.customReset.call(this);
1227+
1228+
return this;
12271229
}
12281230
,setDefaultParams: function(params){
12291231
this.options.setDefaultFilters.call(this);
@@ -1310,13 +1312,12 @@ var unbxdSearchInit = function(jQuery, Handlebars){
13101312
if("start" in obj)
13111313
params.extra.page = (parseInt(obj.start) / parseInt(params.extra.rows)) + 1;
13121314

1313-
if(!("view" in obj)) {
1314-
params.extra.view = ( this.options.viewTypes !== undefined && this.options.viewTypes.length > 0 ? this.options.viewTypes[0] : "");
1315-
} else {
1316-
params.extra.view = obj["view"];
1317-
}
1315+
if("view" in obj)
1316+
params.extra.view = obj['view'];
1317+
else if(this.options.viewTypes && this.options.viewTypes.length > 0)
1318+
params.extra.view = this.options.viewTypes[0];
13181319

1319-
return params;
1320+
return params;
13201321
}
13211322
,paintResultSet: function(obj){
13221323
this._internalPaintResultSet(obj,true);

0 commit comments

Comments
 (0)