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

p-panel toggle on header click #5694

Closed
rashnk opened this issue May 7, 2018 · 4 comments
Closed

p-panel toggle on header click #5694

rashnk opened this issue May 7, 2018 · 4 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@rashnk
Copy link
Contributor

rashnk commented May 7, 2018

How can i toggle p-panel on header click, now it toggle only when i click plus and minus icon

@rafa-suagu
Copy link

rafa-suagu commented May 23, 2018

For now is not possible @rashnk. If you want to achieve this behaviour you should use the collapsed attribute and manage manually the value.
Take care about this solution because if you use this way, you loose the event onBeforeToggle. This seems to be a bug, what do you think @cagataycivici ?

Anyway I think this is a common behaviour that can be an option of this component.

@rafa-suagu
Copy link

rafa-suagu commented May 23, 2018

@cagataycivici if you want I can do the PR, it's very easy, just use the following code:

On the template (panel.ts):

(@panelContent.start)="onToggleStart($event)"

On the component (panel.ts):

onToggleStart(event: Event) {
  this.animating = true;
  this.onBeforeToggle.emit({originalEvent: event, collapsed: this.collapsed});
}

And remove the lines 85-86 from the panel.ts

@cagataycivici cagataycivici self-assigned this Oct 14, 2018
@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label Oct 14, 2018
@cagataycivici cagataycivici added this to the 6.1.5 milestone Oct 14, 2018
@cagataycivici
Copy link
Member

Added toggler property;

<p-panel toggler="icon | header"

Setting it to header gives you the required behavior.

@sridhark158
Copy link

.ui-panel .ui-panel-titlebar .ui-panel-titlebar-icon{
width:100% !important;
}

after that

span.pi-minus{
float:right !important;
}
span.pi-plus{
float:right !important;
}
this css trick will work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

4 participants