issue #22996: notify cancel now is null, to be differentiable from notify ok
authorSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 19 Jun 2014 20:00:44 +0000 (16:00 -0400)
committerSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 19 Jun 2014 20:00:44 +0000 (16:00 -0400)
lib/backbone-x/source/model_mixin.js
lib/enyo-x/source/views/module_container.js
lib/enyo-x/source/widgets/address.js

index 8b54e4b..42ff347 100644 (file)
     QUESTION:  3,
 
     /**
-      Constant for `notify` message type question.
+      Constant for `notify` message type question with cancel option.
 
       @static
       @constant
     */
     YES_NO_CANCEL:  4,
 
+    /**
+      Constant for `notify` message type ok/cancel.
+
+      @static
+      @constant
+      @type Number
+      @default 5
+    */
+    OK_CANCEL:  5,
+
     _status: {
       CLEAN:            0x0001, // 1
       DIRTY:            0x0002, // 2
index 1ca2f3a..dff7f03 100644 (file)
@@ -241,6 +241,7 @@ trailing:true, white:true*/
       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);
@@ -385,7 +386,7 @@ trailing:true, white: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.
index 223543e..ff93d20 100644 (file)
@@ -310,7 +310,7 @@ regexp:true, undef:true, trailing:true, white:true, strict:false */
                     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