ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-12091 Error-popup appears only first time. (atkach)
Date Tue, 23 Jun 2015 15:05:16 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 19c85e0d3 -> bd3d83fdc


AMBARI-12091 Error-popup appears only first time. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bd3d83fd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bd3d83fd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bd3d83fd

Branch: refs/heads/trunk
Commit: bd3d83fdc8dd58f56a6a5685b051d2d3818e1326
Parents: 19c85e0
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Tue Jun 23 17:30:31 2015 +0300
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Tue Jun 23 18:05:06 2015 +0300

----------------------------------------------------------------------
 .../resources/ui/app/mixins/ajax_error_handler.js     | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bd3d83fd/contrib/views/slider/src/main/resources/ui/app/mixins/ajax_error_handler.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/mixins/ajax_error_handler.js b/contrib/views/slider/src/main/resources/ui/app/mixins/ajax_error_handler.js
index 1afb191..90614b5 100644
--- a/contrib/views/slider/src/main/resources/ui/app/mixins/ajax_error_handler.js
+++ b/contrib/views/slider/src/main/resources/ui/app/mixins/ajax_error_handler.js
@@ -43,6 +43,7 @@ App.AjaxErrorHandler = Ember.Mixin.create({
    * @showErrorPopup {boolean}
    */
   defaultErrorHandler: function (jqXHR, url, method, showErrorPopup) {
+    var self = this;
     method = method || 'GET';
     var context = this.get('isController') ? this : (this.get('isView') && this.get('controller'));
     try {
@@ -65,20 +66,17 @@ App.AjaxErrorHandler = Ember.Mixin.create({
           api: Em.I18n.t('ajax.apiInfo').format(method, url),
           statusCode: Em.I18n.t('ajax.statusCode').format(jqXHR.status),
           message: message,
-          showMessage: !!message
+          showMessage: !!message,
+          willDestroyElement: function () {
+            self.set('errorPopupShown', false);
+          }
         }),
         [
-          Ember.Object.create({title: Em.I18n.t('ok'), clicked: "errorPopupClose", dismiss:
'modal', type:'success'})
+          Ember.Object.create({title: Em.I18n.t('ok'), dismiss: 'modal', type: 'success'})
         ],
         context
       );
       this.set('errorPopupShown', true);
     }
-  },
-  actions: {
-
-    errorPopupClose: function () {
-      this.set('errorPopupShown', false);
-    }
   }
 });
\ No newline at end of file


Mime
View raw message