forked from B-3PO/angular-material-expansion-panel
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
md-expansion-panel
emit events on state change
These are the name of the events: * `mdExpansionPanelExpanding`: when it starts to expand * `mdExpansionPanelExpanded`: when it has finished expanding * `mdExpansionPanelCollapsing`: when it starts to collapsed * `mdExpansionPanelCollapsed`: when it has finished to collapse Close issue B-3PO#41
- Loading branch information
1 parent
b849786
commit 876127e
Showing
8 changed files
with
251 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
angular | ||
.module('angularMaterialExpansionPanel') | ||
.controller('EventsController', EventsController); | ||
|
||
|
||
function EventsController($scope, $mdExpansionPanel) { | ||
$mdExpansionPanel().waitFor('expansionPanelOne').then(function (instance) { | ||
instance.expand(); | ||
}); | ||
|
||
$scope.$on("mdExpansionPanelExpanding", function($event, componentId) { | ||
alert("expansion panel " + componentId + " expanding"); | ||
}); | ||
$scope.$on("mdExpansionPanelExpanded", function($event, componentId) { | ||
alert("expansion panel " + componentId + " expanded"); | ||
}); | ||
$scope.$on("mdExpansionPanelCollapsing", function($event, componentId) { | ||
alert("expansion panel " + componentId + " collapsing"); | ||
}); | ||
$scope.$on("mdExpansionPanelCollapsed", function($event, componentId) { | ||
alert("expansion panel " + componentId + " collapsed"); | ||
}); | ||
|
||
|
||
$scope.collapseOne = function () { | ||
$mdExpansionPanel('expansionPanelOne').collapse(); | ||
}; | ||
|
||
$scope.isDisabled = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
<h2>Events</h2> | ||
|
||
|
||
<p> | ||
<b>Expansion Panels</b> $emit the following events | ||
<ul> | ||
<li><code>mdExpansionPanelExpanding</code>: when it starts to expand</li> | ||
<li><code>mdExpansionPanelExpanded</code>: when it has finished expanding</li> | ||
<li><code>mdExpansionPanelCollapsing</code>: when it starts to collapsed</li> | ||
<li><code>mdExpansionPanelCollapsed</code>: when it has finished to collapse</li> | ||
</ul> | ||
The <code>md-component-id</code> of the concerned <code>md-expansion-panel</code> will be passed as argument. | ||
</p> | ||
|
||
<div style="padding-top: 12px; padding-bottom: 36px;"> | ||
<md-divider></md-divider> | ||
</div> | ||
|
||
|
||
|
||
<md-expansion-panel md-component-id="expansionPanelOne"> | ||
|
||
<md-expansion-panel-collapsed> | ||
<div class="md-title">Title</div> | ||
<div class="md-summary">Summary</div> | ||
<md-expansion-panel-icon></md-expansion-panel-icon> | ||
</md-expansion-panel-collapsed> | ||
|
||
<md-expansion-panel-expanded> | ||
|
||
<md-expansion-panel-header> | ||
<div class="md-title">Expanded Title</div> | ||
<div class="md-summary">Expanded Summary</div> | ||
<md-expansion-panel-icon></md-expansion-panel-icon> | ||
</md-expansion-panel-header> | ||
|
||
<md-expansion-panel-content> | ||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
</md-expansion-panel-content> | ||
|
||
<md-expansion-panel-footer> | ||
<div flex></div> | ||
<md-button class="md-warn" ng-click="collapseOne()">Collapse</md-button> | ||
</md-expansion-panel-footer> | ||
|
||
</md-expansion-panel-expanded> | ||
|
||
</md-expansion-panel> | ||
|
||
|
||
<md-expansion-panel> | ||
|
||
<md-expansion-panel-collapsed> | ||
<md-expansion-panel-icon></md-expansion-panel-icon> | ||
<div class="md-title">Sticky</div> | ||
<div class="md-summary">header and footer will stick</div> | ||
</md-expansion-panel-collapsed> | ||
|
||
<md-expansion-panel-expanded> | ||
|
||
<md-expansion-panel-header> | ||
<md-expansion-panel-icon></md-expansion-panel-icon> | ||
<div class="md-title">Sticky</div> | ||
<div class="md-summary">header and footer will stick</div> | ||
</md-expansion-panel-header> | ||
|
||
<md-expansion-panel-content> | ||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
</md-expansion-panel-content> | ||
|
||
<md-expansion-panel-footer> | ||
<div flex></div> | ||
<md-button class="md-warn" ng-click="$panel.collapse()">Collapse</md-button> | ||
</md-expansion-panel-footer> | ||
|
||
</md-expansion-panel-expanded> | ||
|
||
</md-expansion-panel> | ||
|
||
|
||
|
||
|
||
<md-expansion-panel> | ||
|
||
<md-expansion-panel-collapsed> | ||
<div class="md-title">No Sticky</div> | ||
<div class="md-summary">header and footer sticky disabled</div> | ||
</md-expansion-panel-collapsed> | ||
|
||
<md-expansion-panel-expanded> | ||
|
||
<md-expansion-panel-header md-no-sticky> | ||
<div class="md-title">No Sticky</div> | ||
<div class="md-summary">header and footer sticky disabled</div> | ||
</md-expansion-panel-header> | ||
|
||
<md-expansion-panel-content> | ||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
|
||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
</md-expansion-panel-content> | ||
|
||
<md-expansion-panel-footer md-no-sticky> | ||
<div flex></div> | ||
<md-button class="md-warn" ng-click="$panel.collapse()">Collapse</md-button> | ||
</md-expansion-panel-footer> | ||
|
||
</md-expansion-panel-expanded> | ||
|
||
</md-expansion-panel> | ||
|
||
|
||
|
||
<md-expansion-panel ng-disabled="isDisabled"> | ||
|
||
<md-expansion-panel-collapsed> | ||
<div class="md-title">Disabled Panel</div> | ||
<span flex></span> | ||
<md-expansion-panel-icon></md-expansion-panel-icon> | ||
</md-expansion-panel-collapsed> | ||
|
||
<md-expansion-panel-expanded> | ||
|
||
<md-expansion-panel-header> | ||
<div class="md-title">Disabled Panel</div> | ||
<div class="md-summary">Expanded Summary</div> | ||
<md-expansion-panel-icon></md-expansion-panel-icon> | ||
</md-expansion-panel-header> | ||
|
||
<md-expansion-panel-content> | ||
<h4>Content</h4> | ||
<p>Put content in here</p> | ||
</md-expansion-panel-content> | ||
|
||
<md-expansion-panel-footer> | ||
<div flex></div> | ||
<md-button class="md-warn" ng-click="$panel.collapse()">Collapse</md-button> | ||
</md-expansion-panel-footer> | ||
|
||
</md-expansion-panel-expanded> | ||
|
||
</md-expansion-panel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.