Skip to content

Commit 5a17e47

Browse files
committed
Made config optional in the http methods in Utils.js
1 parent 563bd3e commit 5a17e47

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils/Utils.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ javaxt.dhtml.utils = {
3333
* http() method for a full range of options.
3434
*/
3535
get: function(url, config){
36+
if (!config) config = {};
3637

3738
if (config.payload!=null){ //convert to post request
3839
var payload = config.payload;
@@ -77,6 +78,7 @@ javaxt.dhtml.utils = {
7778
/** Used to execute an HTTP DELETE request.
7879
*/
7980
delete: function(url, config){
81+
if (!config) config = {};
8082
config.method = "DELETE";
8183
return javaxt.dhtml.utils.http(url, config);
8284
},
@@ -88,6 +90,9 @@ javaxt.dhtml.utils = {
8890
/** Used to execute an HTTP request.
8991
*/
9092
http: function(url, config){
93+
if (!config) config = {
94+
method: "GET"
95+
};
9196

9297
var cache = false; //no caching by default!
9398
if (config.cache){
@@ -1662,7 +1667,7 @@ javaxt.dhtml.utils = {
16621667
};
16631668

16641669

1665-
win = new javaxt.dhtml.Window(document.body, {
1670+
javaxt.dhtml.utils.merge(config, {
16661671
width: 450,
16671672
height: 150,
16681673
valign: "top",
@@ -1677,6 +1682,9 @@ javaxt.dhtml.utils = {
16771682
body: "window-body confirm-body"
16781683
}
16791684
});
1685+
1686+
1687+
win = new javaxt.dhtml.Window(document.body, config);
16801688
javaxt.dhtml.utils.Confirm = win;
16811689

16821690

0 commit comments

Comments
 (0)