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

Destroy content of the pane when collapsed #26

Closed
slavafomin opened this issue Oct 14, 2015 · 3 comments
Closed

Destroy content of the pane when collapsed #26

slavafomin opened this issue Oct 14, 2015 · 3 comments

Comments

@slavafomin
Copy link

Hello!

Thank you for this great module, we are using it in one of our projects.

However, I have an issue. I have multiple panes and each pane contains a youtube video player (iframe). If you start to play the video and then collapse the pane, the video will still be playing (you can hear audio). I want to prevent this.

What is the best possible solution to this problem you will recommend? Thank you!


I have the following structure:

<v-pane-header>
    <header>Video #1</header>
</v-pane-header>
<v-pane-content>
    <iframe
        src="https://www.youtube.com/embed/uueMI3F3jzE"
    ></iframe>
</v-pane-content>

I think the great solution would be to do something like this:

<iframe ng-if="thisPane.isOpen()">

@slavafomin
Copy link
Author

I've managed to solve this problem using following approach:

$scope.onExpand = function (index) {
  $scope.expandedPaneIndex = index;
};
<iframe
    ng-if="2 == expandedPaneIndex"
></iframe>

It works, however, I don't really like this solution. It's pretty fragile.

LukaszWatroba added a commit that referenced this issue Oct 29, 2015
@LukaszWatroba
Copy link
Owner

Hey!

Please download the latest release – v1.4.0. Now you can use $pane.isExpanded() scope function to check whether the pane is expanded or collapsed.

Example:

<v-pane-header>
    <header>Video #1</header>
</v-pane-header>
<v-pane-content>
    <iframe ng-if="$pane.isExpanded()" src="https://www.youtube.com/embed/uueMI3F3jzE"
    ></iframe>
</v-pane-content>

Sorry for the late reply.

@slavafomin
Copy link
Author

You are the best Lukasz! ))
Thank's a lot )

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

No branches or pull requests

2 participants