Show More
@@ -24,7 +24,7 b' function($, utils) {' | |||||
24 | }; |
|
24 | }; | |
25 |
|
25 | |||
26 | ConfigSection.prototype.api_url = function() { |
|
26 | ConfigSection.prototype.api_url = function() { | |
27 |
return utils.url_join_encode(this.base_url, 'api/config', th |
|
27 | return utils.url_join_encode(this.base_url, 'api/config', this.section_name); | |
28 | }; |
|
28 | }; | |
29 |
|
29 | |||
30 | ConfigSection.prototype._load_done = function() { |
|
30 | ConfigSection.prototype._load_done = function() { | |
@@ -35,18 +35,20 b' function($, utils) {' | |||||
35 | }; |
|
35 | }; | |
36 |
|
36 | |||
37 | ConfigSection.prototype.load = function() { |
|
37 | ConfigSection.prototype.load = function() { | |
|
38 | var that = this; | |||
38 | return utils.promising_ajax(this.api_url(), { |
|
39 | return utils.promising_ajax(this.api_url(), { | |
39 | cache: false, |
|
40 | cache: false, | |
40 | type: "GET", |
|
41 | type: "GET", | |
41 | dataType: "json", |
|
42 | dataType: "json", | |
42 | }).then(function(data) { |
|
43 | }).then(function(data) { | |
43 |
th |
|
44 | that.data = data; | |
44 |
th |
|
45 | that._load_done(); | |
45 | return data; |
|
46 | return data; | |
46 | }); |
|
47 | }); | |
47 | }; |
|
48 | }; | |
48 |
|
49 | |||
49 | ConfigSection.prototype.update = function(newdata) { |
|
50 | ConfigSection.prototype.update = function(newdata) { | |
|
51 | var that = this; | |||
50 | return utils.promising_ajax(this.api_url(), { |
|
52 | return utils.promising_ajax(this.api_url(), { | |
51 | processData: false, |
|
53 | processData: false, | |
52 | type : "PATCH", |
|
54 | type : "PATCH", | |
@@ -54,8 +56,8 b' function($, utils) {' | |||||
54 | dataType : "json", |
|
56 | dataType : "json", | |
55 | contentType: 'application/json', |
|
57 | contentType: 'application/json', | |
56 | }).then(function(data) { |
|
58 | }).then(function(data) { | |
57 |
th |
|
59 | that.data = data; | |
58 |
th |
|
60 | that._load_done(); | |
59 | return data; |
|
61 | return data; | |
60 | }); |
|
62 | }); | |
61 | }; |
|
63 | }; |
General Comments 0
You need to be logged in to leave comments.
Login now