Adding new save-bar directive for handling save actions for index pages

This commit is contained in:
Rob Harrington
2015-11-06 09:53:31 +11:00
parent 330882c689
commit 27903a46e6
4 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
angular.module("admin.indexUtils").directive "saveBar", ->
restrict: "E"
scope:
save: "&"
saving: "&"
dirty: "&"
templateUrl: "admin/save_bar.html"

View File

@@ -0,0 +1,10 @@
#save-bar.animate-show{ ng: { show: 'dirty()' } }
.twelve.columns.alpha
%h5{ ng: { show: "dirty() && !saving()" } }
You have made unsaved changes
%h5{ ng: { hide: "dirty() || saving()" } }
All changes saved
%h5{ ng: { show: "saving()" } }
Saving...
.four.columns.omega.text-right
%input.red{type: "button", value: "Save Changes", ng: { click: "save()" } }

View File

@@ -0,0 +1,35 @@
@-webkit-keyframes slideInUp
0%
-webkit-transform: translateY(20px)
transform: translateY(20px)
100%
-webkit-transform: translateY(0)
transform: translateY(0)
// @-webkit-keyframes slideOutDown
// 0%
// -webkit-transform: translateY(0)
// transform: translateY(0)
// 100%
// -webkit-transform: translateY(20px)
// transform: translateY(20px)
.animate-show
-webkit-animation-name: slideInUp
animation-name: slideInUp
-webkit-animation-duration: 0.3s
animation-duration: 0.3s
-webkit-animation-fill-mode: both
animation-fill-mode: both
// line-height: 20px
// opacity: 1
// &.ng-hide
// -webkit-animation-name: slideOutDown
// animation-name: slideOutDown
// -webkit-animation-duration: 0.5s
// animation-duration: 0.5s
// -webkit-animation-fill-mode: both
// animation-fill-mode: both
// // line-height: 20px
// // opacity: 1

View File

@@ -0,0 +1,9 @@
#save-bar
position: fixed
bottom: 0px
padding: 8px 10px
font-weight: bold
background-color: #fff
color: #5498da
h5
color: #5498da