Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Compact widget directive (#418)
Browse files Browse the repository at this point in the history
* Adds compact widget card directive

* Removal of widget may be necessary

* Removes uneeded remove button in compact widget dir

* Adds title into aria label of info button
  • Loading branch information
vertein authored Apr 28, 2017
1 parent 9629a63 commit 19c9f3b
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
79 changes: 79 additions & 0 deletions uw-frame-components/css/buckyless/widget.less
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,85 @@
}
}

.list-content {
position: relative;
margin: 5px;
background: #f3f3f3;
border-radius: 3px;
height: 150px;
color: #333;
text-align: center;

&:hover {
cursor: pointer;
}

a {
display: block;
height: 100%;
box-shadow: 0 2px 0 #ddd;
border-radius: 4px;
transition: @background-transition;

&:hover {
background-color: #f8f8f8;
box-shadow: 0 3px 0 #ddd;
}
}

h4 {
font-size: 1.2em;
margin: 0;
color: #333;
padding: 0 5px;
}

div {
display: inline-block;
float: left;
}

.icon-container {
width: 100%;
height: 67%;

i {
color: #333;
vertical-align: middle;
padding: 30px 10px;
font-size: 50px;
}
}

.list-item-container {
display: table;
width: 100%;
height: 33%;

h4 {
display: table-cell;
vertical-align: middle;
}
}
}

.add-favorites {
background: transparent;
border: 1px dashed #ccc;
display: flex;
justify-content: center;
align-items: center;

&:hover {
border: 1px solid #f8f8f8;
}

a {
transition: @background-transition;
box-shadow: 0 0 0 transparent;
}
}

//
.widget-body {
.input-group {
Expand Down
15 changes: 15 additions & 0 deletions uw-frame-components/portal/widgets/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ define(['angular', 'require'], function(angular, require) {
controller: 'WidgetCardController'
};
});

/**
Just the widget card -- gets the widget type from the scope
**/
app.directive('compactWidget', function() {
return {
restrict: 'E',
transclude: true,
scope: {
fname: '@'
},
templateUrl: require.toUrl('./partials/compact-widget-card.html'),
controller: 'WidgetCardController'
};
});

app.directive('widgetIcon', function() {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<md-card class="list-content" id="widget-id-{{::widget.nodeId}}">
<md-button class="widget-action widget-info md-icon-button" aria-label="see a brief description of {{::widget.title}}">
<md-tooltip md-direction="top" class="widget-action-tooltip">
{{widget.description}}
</md-tooltip>
<md-icon>info</md-icon>
</md-button>
<div ng-transclude id="widget-removal"></div>
<a aria-labelledby="appTitle_widget.title-{{::widget.nodeId}}" tabindex="0" ng-href="{{widget.url}}" target="{{::widget.target}}">
<div class="icon-container">
<widget-icon></widget-icon>
</div>
<div class="list-item-container">
<h4 id="appTitle_widget.title-{{::widget.nodeId}}">{{ ::widget.title }}</h4>
</div>
</a>
</md-card>

0 comments on commit 19c9f3b

Please sign in to comment.