Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sidepanel resize #225

Merged
merged 18 commits into from
Feb 27, 2018
Merged

Feature/sidepanel resize #225

merged 18 commits into from
Feb 27, 2018

Conversation

jakublamprecht
Copy link
Contributor

@jakublamprecht jakublamprecht commented Feb 9, 2018

Description

Added possibility of resizing sidepanel and updated sidepanel toggle functionality to work correctly with different widths of sidepanel

Motivation and Context

Test names can get pretty long and are hard to read with current width of the sidepanel.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the AET Contributor License Agreement.

var $content = $('.main');
var $sidepanel = $('.aside');

var isSidepanelResized = false;
Copy link

@mateuszluczak mateuszluczak Feb 13, 2018

Choose a reason for hiding this comment

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

Move consts outside link function


function linkFunc($scope, $element) {
var $body = $('body');
var $content = $('.main');

Choose a reason for hiding this comment

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

Is there a better way of getting that elements? Can't the directive be attached to higher element in DOM and use elements in it's scope?

@@ -22,6 +22,8 @@ define(['angularAMD'], function (angularAMD) {
['$rootScope', 'localStorageService', ToggleSidepanelDirective]);

function ToggleSidepanelDirective($rootScope, localStorageService) {
var $content = $('.main');

Choose a reason for hiding this comment

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

This is also duplicated in the second directive, there should be a way of making that in single place

Copy link

@mateuszluczak mateuszluczak left a comment

Choose a reason for hiding this comment

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

Looks good 👏

$sidepanel.css('left', 0);

$(window).on('resize', onWindowResize);

Choose a reason for hiding this comment

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

Add throttle here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

localStorageService.put(EXPANDED_SIDEBAR_KEY_NAME, true);
}

function close() {
$content.css('left', 0);
$content.css('width', $body.width());
$content.css('width', '100%');

Choose a reason for hiding this comment

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

Can't we just remove width then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, removed width inline style instead

Copy link
Contributor

@michaldziubek michaldziubek left a comment

Choose a reason for hiding this comment

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

Looks good :)

@wiiitek wiiitek merged commit 348ab15 into master Feb 27, 2018
@wiiitek wiiitek deleted the feature/sidepanel-resize branch February 27, 2018 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants