issue #22996: support async getValue from popup component
authorSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 19 Jun 2014 03:03:15 +0000 (23:03 -0400)
committerSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 19 Jun 2014 03:03:15 +0000 (23:03 -0400)
lib/enyo-x/source/views/module_container.js

index 78b91e1..1ca2f3a 100644 (file)
@@ -280,7 +280,7 @@ trailing:true, white:true*/
       // delete out any previously added customComponents/customComponentControls
       if (this.$.notifyPopup.$.customComponent) {
         this.$.notifyPopup.removeComponent(this.$.notifyPopup.$.customComponent);
-        
+
         customComponentControls = _.filter(that.$.notifyPopup.controls, function (control) {
           return control.name === "customComponent";
         });
@@ -369,6 +369,7 @@ trailing:true, white:true*/
     notifyTap: function (inSender, inEvent) {
       var notifyParameter,
         callbackObj = {},
+        that = this,
         optionsObj = this._notifyOptions || {};
 
       this._notifyDone = true;
@@ -391,6 +392,13 @@ trailing:true, white:true*/
         this.$.notifyPopup.hide();
         callbackObj.answer = notifyParameter;
         if (this.$.notifyPopup.$.customComponent) {
+          if (this.$.notifyPopup.$.customComponent.getValueAsync) {
+            this.$.notifyPopup.$.customComponent.getValueAsync(function (result) {
+              callbackObj.componentValue = result;
+              that._notifyCallback(callbackObj, optionsObj);
+            });
+            return;
+          }
           callbackObj.componentValue = this.$.notifyPopup.$.customComponent.getValue();
         }
         this._notifyCallback(callbackObj, optionsObj);