typeToButtonMap[String(XM.Model.WARNING)] = ["notifyOk"];
typeToButtonMap[String(XM.Model.CRITICAL)] = ["notifyOk"];
typeToButtonMap[String(XM.Model.QUESTION)] = ["notifyYes", "notifyNo"];
+ typeToButtonMap[String(XM.Model.OK_CANCEL)] = ["notifyOk", "notifyCancel"];
typeToButtonMap[String(XM.Model.YES_NO_CANCEL)] = ["notifyYes", "notifyNo", "notifyCancel"];
this.$.notifyMessage.setContent(inEvent.message);
// 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";
});
notifyTap: function (inSender, inEvent) {
var notifyParameter,
callbackObj = {},
+ that = this,
optionsObj = this._notifyOptions || {};
this._notifyDone = true;
notifyParameter = false;
break;
case 'notifyCancel':
- notifyParameter = undefined;
+ notifyParameter = null;
break;
}
// the callback might make its own popup, which we do not want to hide.
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);
model.save(null, options);
} else {
- // answer === undefined means that the user wants to cancel this action
+ // answer === null means that the user wants to cancel this action
// fetching is a good way to throw out the changes
model.fetch({success: function () {
// tell the view to re-render