Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

update(panel): refactor positioning to allow multiple. #8211

Closed

Conversation

gmoothart
Copy link
Contributor

@gmoothart gmoothart added needs: review This PR is waiting on review from the team EOC labels Apr 25, 2016
@gmoothart gmoothart added this to the EOC - Q1 milestone Apr 25, 2016
* @name MdPanelPosition#withPanelXPosition
* @param {string} xPosition
* @name MdPanelPosition#withPanelPosition
* @param {string} xpos
Copy link
Contributor

@ErinCoughlan ErinCoughlan Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can you keep these as xPosition and yPosition as it directs the user towards the constants with the same name? (We haven't used pos anywhere public.)

@ErinCoughlan ErinCoughlan force-pushed the feat/panel branch 2 times, most recently from 8f46bd2 to b1c1bde Compare April 26, 2016 15:47
@gmoothart gmoothart force-pushed the intelligent-positioning branch 3 times, most recently from 6273f1e to eefcfbe Compare April 26, 2016 21:03
@gmoothart
Copy link
Contributor Author

PTAL. Comments addressed and API simplified to just one method addPanelPosition that can be called multiple times.

@@ -1765,7 +1776,10 @@ MdPanelPosition.prototype._calculatePanelPosition = function(panelEl) {
var targetRight = targetBounds.right;
var targetWidth = targetBounds.width;

switch (this._xPosition) {
// TODO(gmoothart): intelligently pick the first on-screen position.
var pos = this._positions[0] || {};
Copy link
Contributor

@ErinCoughlan ErinCoughlan Apr 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch variable names pos -> position

@ErinCoughlan
Copy link
Contributor

Please add a test for multiple positions, verifying that they are added to an array.

Then LGTM.

@gmoothart gmoothart force-pushed the intelligent-positioning branch from eefcfbe to 9f4f19e Compare April 26, 2016 21:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: review This PR is waiting on review from the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants