← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21050: PT noext.

 

------------------------------------------------------------
revno: 21050
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-11-13 21:00:40 +0100
message:
  PT noext.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app2.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app2.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app2.js	2015-11-13 19:46:32 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app2.js	2015-11-13 20:00:40 +0000
@@ -70,7 +70,7 @@
                         error: function() {
                             alert('(i18n) No translations found for system locale (' + uiLocale + ') or default locale (' + appManager.defaultUiLocale + ')');
                         },
-                        completed: function() {
+                        complete: function() {
                             requestManager.ok(this);
                         }
                     });
@@ -107,7 +107,7 @@
                     'fields=id,' + displayProperty + 'level',
                     'paging=false'
                 ],
-                fn: function(r) {
+                success: function(r) {
                     appManager.organisationUnitLevels = r.organisationUnitLevels;
 
                     if (!r.organisationUnitLevels.length) {
@@ -125,7 +125,7 @@
                     'fields=id,' + displayProperty + ',legends[id,' + displayProperty + ',startValue,endValue,color]',
                     'paging=false'
                 ],
-                fn: function(r) {
+                success: function(r) {
                     appManager.legendSets = r.legendSets;
                     requestManager.ok(this);
                 }
@@ -161,7 +161,6 @@
 
         //requestManager.set(function() {
 
-
         requestManager.run();
 
         });

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js	2015-11-13 19:46:32 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js	2015-11-13 20:00:40 +0000
@@ -1551,7 +1551,7 @@
                 t.type = N.isString(config.type) ? config.type : 'json';
                 t.success = N.isFunction(config.success) ? config.success : function() { t.defaultSuccess(); };
                 t.error = N.isFunction(config.error) ? config.error : function() { t.defaultError(); };
-                t.completed = N.isFunction(config.completed) ? config.completed : function() { t.defaultCompleted(); };
+                t.complete = N.isFunction(config.complete) ? config.complete : function() { t.defaultComplete(); };
 
                 // defaults
                 t.defaultSuccess = function() {
@@ -1563,7 +1563,7 @@
                 };
 
                 t.defaultError = function() {};
-                t.defaultCompleted = function() {};
+                t.defaultComplete = function() {};
             };
 
             Request.prototype.log = function(text, noError) {
@@ -1629,12 +1629,6 @@
                 }
             };
 
-            Request.prototype.setSuccess = function(fn) {
-                if (N.isFunction(fn)) {
-                    this.success = fn;
-                }
-            };
-
             Request.prototype.setType = function(type) {
                 if (N.isString(type)) {
                     this.type = type;
@@ -1645,6 +1639,24 @@
                 this.manager = manager;
             };
 
+            Request.prototype.setSuccess = function(fn) {
+                if (N.isFunction(fn)) {
+                    this.success = fn;
+                }
+            };
+
+            Request.prototype.setError = function(fn) {
+                if (N.isFunction(fn)) {
+                    this.error = fn;
+                }
+            };
+
+            Request.prototype.setComplete = function(fn) {
+                if (N.isFunction(fn)) {
+                    this.complete = fn;
+                }
+            };
+
             Request.prototype.url = function(extraParams) {
                 extraParams = N.arrayFrom(extraParams);
 
@@ -1663,11 +1675,11 @@
                         url: this.url(),
                         success: config.success || t.success,
                         error: config.error || t.error,
-                        completed: config.completed || t.completed
+                        complete: config.complete || t.complete
                     });
                 }
                 else {
-                    return $.getJSON(this.url(), config.success || t.success).error(config.error || t.error).completed(config.completed || t.completed);
+                    return $.getJSON(this.url(), config.success || t.success).error(config.error || t.error).complete(config.complete || t.complete);
                 }
             };
         })();