Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Rubin authored and Ben Rubin committed Oct 25, 2016
1 parent dc9396a commit bcea0b2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 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.6.2",
"version": "0.7.0",
"description": "Material Design Expansion Panels.",
"main": [
"dist/md-expansion-panel.js",
Expand Down
40 changes: 40 additions & 0 deletions dist/md-expansion-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,11 @@ function expansionPanelGroupDirective() {
$element: $element,
register: register,
getRegistered: getRegistered,
getAll: getAll,
getOpen: getOpen,
remove: remove,
removeAll: removeAll,
collapseAll: collapseAll,
onChange: onChange,
count: panelCount
}, $attrs.mdComponentId);
Expand Down Expand Up @@ -949,6 +952,28 @@ function expansionPanelGroupDirective() {
}
return registered[name];
}


function getAll() {
return Object.keys(panels).map(function (panelId) {
return panels[panelId];
});
}

function getOpen() {
return Object.keys(panels).map(function (panelId) {
return panels[panelId];
}).filter(function (instance) {
return instance.isOpen();
});
}

function collapseAll(noAnimation) {
var animation = noAnimation === true ? false : true;
Object.keys(panels).forEach(function (panelId) {
panels[panelId].collapse({animation: animation});
});
}
}
}
}());
Expand Down Expand Up @@ -1027,8 +1052,11 @@ function expansionPanelGroupService($mdComponentRegistry, $mdUtil, $mdExpansionP
var service = {
add: add,
register: register,
getAll: getAll,
getOpen: getOpen,
remove: remove,
removeAll: removeAll,
collapseAll: collapseAll,
onChange: onChange,
count: count
};
Expand Down Expand Up @@ -1061,6 +1089,18 @@ function expansionPanelGroupService($mdComponentRegistry, $mdUtil, $mdExpansionP
return instance.count();
}

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

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

function collapseAll(noAnimation) {
instance.collapseAll(noAnimation);
}


function add(options, locals) {
locals = locals || {};
Expand Down
Loading

0 comments on commit bcea0b2

Please sign in to comment.