Skip to content

Commit

Permalink
use ng-include to load panel content
Browse files Browse the repository at this point in the history
  • Loading branch information
shanzi committed May 19, 2015
1 parent 499b1b7 commit 435e957
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
Expand Up @@ -6,11 +6,12 @@ class Panel extends Directive
templateUrl: 'views/panel.html'
controller: '_PanelController'
controllerAs: 'panel'
transclude: true
bindToController: true
scope:
title: '@'
title: '='
isCollapsed: '='
template: '='
locked: '='
}


Expand Down
8 changes: 8 additions & 0 deletions www/md_base/src/app/common/directives/panel/panel.less
Expand Up @@ -2,6 +2,10 @@ panel {
display: block;
width: 100%;
padding: 5px;

&.sortable-ghost {
opacity: 0.5;
}

.inner-container {
background: #fff;
Expand All @@ -16,6 +20,10 @@ panel {
color: #999;
cursor: move;
line-height: 36px;

&.locked {
cursor: default;
}
}

.content {
Expand Down
6 changes: 3 additions & 3 deletions www/md_base/src/app/common/directives/panel/panel.tpl.jade
@@ -1,9 +1,9 @@
div.inner-container
div.title-bar(layout="row")
div.title(flex) {{ panel.title }}
div.buttons
div.title(flex, ng-class="{locked: panel.locked}") {{ panel.title }}
div.buttons(ng-if="!panel.locked")
md-button(ng-click="panel.toggleCollapse()")
md-icon(md-svg-icon="expand-panel", ng-show="panel.isCollapsed")
md-icon(md-svg-icon="collapse-panel", ng-show="!panel.isCollapsed")
div.content(ng-transclude="ng-transclude")
div.content(ng-include="panel.template")

@@ -0,0 +1 @@
| current builds panel content
1 change: 1 addition & 0 deletions www/md_base/src/app/home/panels/overview_panel.tpl.jade
@@ -0,0 +1 @@
| overview panel content
@@ -0,0 +1 @@
| recent builds panel content

0 comments on commit 435e957

Please sign in to comment.