Permalink
Browse files

Sets the windowPadding of SC.PickerPane to default value once rather …

…than checking it each time.
  • Loading branch information...
1 parent 970d7cd commit 217109ccb55171b02e6470ed8cbba851c2866c02 @publickeating publickeating committed Mar 3, 2014
Showing with 10 additions and 11 deletions.
  1. +10 −11 frameworks/desktop/panes/picker.js
@@ -1097,15 +1097,6 @@ SC.PickerPane = SC.PalettePane.extend(
offsetKey[3] + overlapTuningY];
this.set('pointerOffset', offset);
- // TODO: What to do about this?
- if (SC.none(this.get('windowPadding'))) {
- this.set('windowPadding', K.WINDOW_PADDING);
- }
- }
- } else {
- // TODO: What to do about this?
- if (SC.none(this.get('windowPadding'))) {
- this.set('windowPadding', K.WINDOW_PADDING);
}
}
@@ -1262,8 +1253,16 @@ SC.PickerPane = SC.PalettePane.extend(
this.positionPane();
},
- /** @private Cleanup. */
- destroy: function() {
+ /** @private SC.Object */
+ init: function () {
+ sc_super();
+
+ // Set defaults that can only be configured on initialization.
+ if (!this.windowPadding) { this.windowPadding = SC.PickerPane.WINDOW_PADDING; }
+ },
+
+ /** @private SC.Object */
+ destroy: function () {
this._scrollView = null;
this._anchorView = null;
this._anchorHTMLElement = null;

0 comments on commit 217109c

Please sign in to comment.