Code review comment for lp:~salgado/lazr-js/picker-refactoring

Revision history for this message
Guilherme Salgado (salgado) wrote :

My changes have caused the picker not to be hidden when we click on the close button, so I had to do the changes below to fix it.

=== modified file 'src-js/lazrjs/picker/picker.js'
--- src-js/lazrjs/picker/picker.js 2009-11-12 16:02:51 +0000
+++ src-js/lazrjs/picker/picker.js 2009-11-12 16:58:01 +0000
@@ -72,6 +72,7 @@
     /**
      * Whether or not the widget should be cleared when the save event is
      * fired.
+ *
      * @property clear_on_save
      * @type Boolean
      * default true
@@ -81,6 +82,7 @@
     /**
      * Whether or not the widget should be cleared when the cancel event is
      * fired.
+ *
      * @property clear_on_cancel
      * @type Boolean
      * default false
@@ -630,6 +632,7 @@
      * @protected
      */
     _defaultCancel : function(e) {
+ Picker.superclass._defaultCancel.apply(this, arguments);
         if ( this.clear_on_cancel ) {
             this._clear();
         }

=== modified file 'src-js/lazrjs/picker/tests/picker.js'
--- src-js/lazrjs/picker/tests/picker.js 2009-11-12 16:02:51 +0000
+++ src-js/lazrjs/picker/tests/picker.js 2009-11-12 16:55:25 +0000
@@ -379,6 +379,14 @@
             }, 3000);
     },

+ test_cancel_event_hides_widget: function () {
+ this.picker.render();
+
+ this.picker.fire('cancel', 'bogus');
+ Assert.isFalse(
+ this.picker.get('visible'), "The widget should be hidden.");
+ },
+
     test_save_event_hides_widget: function () {
         this.picker.render();

« Back to merge proposal