-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created the item-panel directive and updated the post and user states…
… to make use of them
- Loading branch information
Showing
16 changed files
with
315 additions
and
206 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.animated-panel { | ||
overflow:hidden; | ||
} | ||
.animated-panel.ng-hide { | ||
max-height: 0; | ||
} | ||
.animated-panel.ng-hide-add.ng-hide-add-active, | ||
.animated-panel.ng-hide-remove.ng-hide-remove-active { | ||
-webkit-transition: all linear 0.25s; | ||
transition: all linear 0.25s; | ||
} | ||
|
||
.animated-panel-small { | ||
max-height: 100px; | ||
} | ||
.animated-panel-med { | ||
max-height: 400px; | ||
} | ||
.animated-panel-large { | ||
max-height: 800px; | ||
} |
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,17 @@ | ||
<div class="item-panel"> | ||
|
||
<div class="item-panel-delete animated-panel animated-panel-small" ng-show="confirmDelete"> | ||
<div>Are you sure you want to delete this item? </div> | ||
<remove-button ng-click="onDelete(model)" no-icon="true" text="'Yes'"></remove-button> | ||
<remove-button ng-click="confirmDelete=false" no-icon="true" text="'No'"></remove-button> | ||
</div> | ||
|
||
<div class="arrow animate-fast" ng-click="more = (more === undefined ? true : !more )" ng-class="{ active : more }"></div> | ||
<div class="cross" ng-if="onDelete" ng-style="{ visibility : ($parent.confirmDelete ? 'hidden' : '' ) }" ng-click="$parent.confirmDelete = true"></div> | ||
<div class="item-panel-preview" ng-transclude="preview"></div> | ||
|
||
|
||
<div class="item-panel-content animated-panel animated-panel-large" ng-show="more" ng-transclude="content"></div> | ||
|
||
|
||
</div> |
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,35 @@ | ||
module clientAdmin | ||
{ | ||
/** | ||
* Small directive that represents an div item that has a preview, content and delete section. | ||
* Ideal for database entries displayed in a list. | ||
*/ | ||
export class ItemPanel implements ng.IDirective | ||
{ | ||
restrict = 'E'; | ||
transclude = { | ||
'preview': 'panelPreview', | ||
'content': 'panelContent' | ||
}; | ||
templateUrl = 'directives/item-panel/item-panel.html'; | ||
scope = { | ||
onDelete: '=?', | ||
model: '=?', | ||
confirmDelete : '=?' | ||
} | ||
|
||
link( scope ) | ||
{ | ||
scope.confirmDelete = scope.confirmDelete || false; | ||
} | ||
|
||
/** | ||
* Creates an intance of the pager directive | ||
*/ | ||
static factory(): ng.IDirectiveFactory | ||
{ | ||
var directive = () => new ItemPanel(); | ||
return directive; | ||
} | ||
} | ||
} |
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,40 @@ | ||
|
||
|
||
.item-panel { | ||
margin: 10px; | ||
padding: 5px; | ||
background:$primary-background; | ||
|
||
.nav-button a { | ||
margin: 0 8px 0 0; | ||
font-size: 20px; | ||
} | ||
|
||
.item-panel-delete { | ||
background: #FFDCDC; | ||
padding: 10px; | ||
margin:0 0 20px 0; | ||
|
||
.button { | ||
margin:10px 10px 0 0; | ||
} | ||
} | ||
|
||
.cross { | ||
float:right; | ||
margin: 4px 8px; | ||
cursor:pointer; | ||
|
||
-ms-transform: rotate(45deg); | ||
-webkit-transform: rotate(45deg); | ||
transform: rotate(45deg); | ||
|
||
&:hover{ | ||
&:before, &:after{ | ||
background: red; | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
.user-confirmation { | ||
max-height: 100px; | ||
background: #FFDCDC; | ||
.new-user-form { | ||
overflow: auto; | ||
background: $primary-background; | ||
margin: 10px; | ||
padding: 10px; | ||
} | ||
.user-confirmation div { | ||
margin:0 0 10px 0; | ||
} |
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.