Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Rubin authored and Ben Rubin committed Jul 6, 2016
1 parent 097e6ed commit 316cdcb
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 32 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-material-expansion-panel",
"version": "0.4.2",
"version": "0.4.3",
"description": "Material Design Expansion Panels.",
"main": [
"dist/md-expansion-panel.js",
Expand Down
52 changes: 26 additions & 26 deletions dist/md-expansion-panel.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
md-expansion-panel md-expansion-panel-collapsed,
md-expansion-panel .md-expansion-panel-footer-container,
md-expansion-panel .md-expansion-panel-header-container {
md-expansion-panel {
background: #FFF; }
md-expansion-panel md-expansion-panel-collapsed .md-title,
md-expansion-panel md-expansion-panel-collapsed .md-summary,
md-expansion-panel .md-expansion-panel-footer-container .md-title,
md-expansion-panel .md-expansion-panel-footer-container .md-summary,
md-expansion-panel .md-expansion-panel-header-container .md-title,
md-expansion-panel .md-expansion-panel-header-container .md-summary {
color: #333; }

md-expansion-panel md-expansion-panel-footer .md-expansion-panel-footer-container,
md-expansion-panel md-expansion-panel-header .md-expansion-panel-header-container {
border-color: #DDD; }

md-expansion-panel .md-expansion-panel-icon-container .md-expansion-panel-icon {
color: #999; }

md-expansion-panel[disabled] md-expansion-panel-collapsed {
color: #DDD; }

md-expansion-panel:not(.md-open):not([disabled]):focus,
md-expansion-panel:not(.md-open):not([disabled]):focus md-expansion-panel-collapsed {
background: #EEE; }
md-expansion-panel md-expansion-panel-collapsed,
md-expansion-panel .md-expansion-panel-footer-container,
md-expansion-panel .md-expansion-panel-header-container {
background: #FFF; }
md-expansion-panel md-expansion-panel-collapsed .md-title,
md-expansion-panel md-expansion-panel-collapsed .md-summary,
md-expansion-panel .md-expansion-panel-footer-container .md-title,
md-expansion-panel .md-expansion-panel-footer-container .md-summary,
md-expansion-panel .md-expansion-panel-header-container .md-title,
md-expansion-panel .md-expansion-panel-header-container .md-summary {
color: #333; }
md-expansion-panel md-expansion-panel-footer .md-expansion-panel-footer-container,
md-expansion-panel md-expansion-panel-header .md-expansion-panel-header-container {
border-color: #DDD; }
md-expansion-panel .md-expansion-panel-icon-container .md-expansion-panel-icon {
color: #999; }
md-expansion-panel[disabled] md-expansion-panel-collapsed {
color: #DDD; }
md-expansion-panel:not(.md-open):not([disabled]):focus,
md-expansion-panel:not(.md-open):not([disabled]):focus md-expansion-panel-collapsed {
background: #EEE; }

.layout-padding > md-expansion-panel-group {
padding: 0; }

/* --- Expansion Panel --- */
md-expansion-panel {
Expand Down Expand Up @@ -98,8 +99,7 @@ md-expansion-panel-collapsed {
/* --- Expansion Panel Expanded --- */
md-expansion-panel-expanded {
display: none;
min-height: 48px;
line-height: 48px; }
min-height: 48px; }
md-expansion-panel-expanded.md-show {
-webkit-transition: max-height 0.12s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.12s cubic-bezier(0.25, 0.8, 0.25, 1);
transition: max-height 0.12s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.12s cubic-bezier(0.25, 0.8, 0.25, 1); }
Expand Down
40 changes: 38 additions & 2 deletions dist/md-expansion-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ function expansionPanelGroupDirective() {
var deregister;
var registered = {};
var panels = {};
var onChangeFuncs = [];
var multipleExpand = $attrs.mdMultiple !== undefined || $attrs.multiple !== undefined;
var autoExpand = $attrs.mdAutoExpand !== undefined || $attrs.autoExpand !== undefined;

Expand All @@ -686,7 +687,9 @@ function expansionPanelGroupDirective() {
register: register,
getRegistered: getRegistered,
remove: remove,
removeAll: removeAll
removeAll: removeAll,
onChange: onChange,
count: panelCount
}, $attrs.mdComponentId);

vm.addPanel = addPanel;
Expand All @@ -708,12 +711,30 @@ function expansionPanelGroupDirective() {
});



function onChange(callback) {
onChangeFuncs.push(callback);

return function () {
onChangeFuncs.splice(onChangeFuncs.indexOf(callback), 1);
};
}

function callOnChange() {
var count = panelCount();
onChangeFuncs.forEach(function (func) {
func(count);
});
}


function addPanel(componentId, panelCtrl) {
panels[componentId] = panelCtrl;
if (autoExpand === true) {
panelCtrl.expand();
closeOthers(componentId);
}
callOnChange();
}

function expandPanel(componentId) {
Expand All @@ -732,6 +753,11 @@ function expansionPanelGroupDirective() {

function removePanel(componentId) {
delete panels[componentId];
callOnChange();
}

function panelCount() {
return Object.keys(panels).length;
}

function closeOthers(id) {
Expand Down Expand Up @@ -836,7 +862,9 @@ function expansionPanelGroupService($mdComponentRegistry, $mdUtil, $mdExpansionP
add: add,
register: register,
remove: remove,
removeAll: removeAll
removeAll: removeAll,
onChange: onChange,
count: count
};

return service;
Expand All @@ -859,6 +887,14 @@ function expansionPanelGroupService($mdComponentRegistry, $mdUtil, $mdExpansionP
instance.removeAll();
}

function onChange(callback) {
return instance.onChange(callback);
}

function count() {
return instance.count();
}


function add(options, locals) {
locals = locals || {};
Expand Down
2 changes: 1 addition & 1 deletion dist/md-expansion-panel.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 316cdcb

Please sign in to comment.