Updated edit UI for keeping save/cancel buttons on the bottom of the screen

This commit is contained in:
Giulio Cesare Solaroli 2015-10-01 16:40:05 +02:00
parent 02d4fa0e93
commit 73165361d4
5 changed files with 82 additions and 6 deletions

View File

@ -1221,11 +1221,28 @@ div.cardContent {
height: 48px; height: 48px;
line-height: 48px; } line-height: 48px; }
.cardDetailToolbar.edit { .cardDetailToolbar.edit {
-webkit-box-ordinal-group: 2;
-webkit-order: 1;
-moz-order: 1;
-ms-flex-order: 1;
order: 1;
-webkit-transform: translate3d(0, 0, 0); } -webkit-transform: translate3d(0, 0, 0); }
.cardDetailToolbar.edit li.save { .cardDetailToolbar.edit li.save {
cursor: default; } cursor: default;
background-color: #55aa55; }
.cardDetailToolbar.edit li.cancel {
background-color: #666666; }
.cardDetailToolbar.edit li.cancel:hover {
background-color: #444444; }
.cardDetailToolbar.edit.hasPendingChanges li.save { .cardDetailToolbar.edit.hasPendingChanges li.save {
cursor: pointer; } cursor: pointer;
background-color: #22aa22; }
.cardDetailToolbar.edit.hasPendingChanges li.save:hover {
background-color: #1a801a; }
.cardDetailToolbar.edit.hasPendingChanges li.cancel {
background-color: #aa2222; }
.cardDetailToolbar.edit.hasPendingChanges li.cancel:hover {
background-color: #dd1111; }
.cardDetailToolbar.commands > div { .cardDetailToolbar.commands > div {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
@ -3235,6 +3252,17 @@ div.cardList.narrow {
#cardDetailPage .edit .cardDetailToolbar, .cardDetail .edit .cardDetailToolbar { #cardDetailPage .edit .cardDetailToolbar, .cardDetail .edit .cardDetailToolbar {
background-color: #1863a1; background-color: #1863a1;
color: white; } color: white; }
#cardDetailPage .edit .cardDetailToolbar.narrow, .cardDetail .edit .cardDetailToolbar.narrow {
-webkit-transition: height 2.5s ease-in;
-moz-transition: height 2.5s ease-in;
-o-transition: height 2.5s ease-in;
-ms-transition: height 2.5s ease-in;
transition: height 2.5s ease-in; }
#cardDetailPage .edit .cardDetailToolbar.narrow.commands, .cardDetail .edit .cardDetailToolbar.narrow.commands {
height: 12px; }
#cardDetailPage .edit .cardDetailToolbar.narrow.commands div, .cardDetail .edit .cardDetailToolbar.narrow.commands div {
display: none;
visibility: hidden; }
#cardDetailPage .edit .cardField, .cardDetail .edit .cardField { #cardDetailPage .edit .cardField, .cardDetail .edit .cardField {
border-top: 1px solid #eee; } border-top: 1px solid #eee; }
#cardDetailPage .edit .cardField:last-child, .cardDetail .edit .cardField:last-child { #cardDetailPage .edit .cardField:last-child, .cardDetail .edit .cardField:last-child {
@ -3274,6 +3302,10 @@ div.cardList.narrow {
vertical-align: bottom; vertical-align: bottom;
padding-left: 17px; } padding-left: 17px; }
.edit .cardDetailToolbar.commands div, .edit .cardDetailToolbar.commands ul {
display: none;
visibility: hidden; }
.cardDetailToolbar.edit li { .cardDetailToolbar.edit li {
font-weight: 100; } font-weight: 100; }
.cardDetailToolbar.edit li:hover { .cardDetailToolbar.edit li:hover {

File diff suppressed because one or more lines are too long

View File

@ -611,6 +611,7 @@ console.log("DROP"); //, anEvent);
return React.DOM.div({'className':'editWrapper'}, [ return React.DOM.div({'className':'editWrapper'}, [
this.props['showGlobalMask'] ? null : React.DOM.div({'className':'mask'}), this.props['showGlobalMask'] ? null : React.DOM.div({'className':'mask'}),
React.DOM.div({'className':Clipperz.PM.UI.Components.classNames(classes)},[ React.DOM.div({'className':Clipperz.PM.UI.Components.classNames(classes)},[
Clipperz.PM.UI.Components.Cards.CommandToolbar(this.props),
Clipperz.PM.UI.Components.Cards.EditToolbar(this.props), Clipperz.PM.UI.Components.Cards.EditToolbar(this.props),
React.DOM.div({'className':'content'}, [ React.DOM.div({'className':'content'}, [
this.renderLabel(this.props['label']), this.renderLabel(this.props['label']),

View File

@ -512,15 +512,38 @@ div.cardContent {
line-height: $mainCardToolbarHeight; line-height: $mainCardToolbarHeight;
&.edit { &.edit {
@include order(1);
@include chromeFix(); @include chromeFix();
li.save { li.save {
cursor: default; cursor: default;
background-color: #55aa55;
}
li.cancel {
background-color: #666666;
&:hover {
background-color: #444444;
};
} }
&.hasPendingChanges { &.hasPendingChanges {
li.save { li.save {
cursor: pointer; cursor: pointer;
background-color: #22aa22;
&:hover {
background-color: #1a801a;
};
}
li.cancel {
background-color: #aa2222;
&:hover {
background-color: #dd1111;
};
} }
} }
} }

View File

@ -267,7 +267,18 @@ $cardViewBasePadding: 10px;
background-color: $cardToolbarBackgroundColor; background-color: $cardToolbarBackgroundColor;
color: white; color: white;
// box-shadow: inset 2px 0 6px 0 rgba(0, 0, 0, 0.1); &.narrow {
@include transition(height, 2.5s, ease-in);
&.commands {
height: 12px;
div {
display: none;
visibility: hidden;
}
}
}
} }
.cardField { .cardField {
@ -316,7 +327,16 @@ $cardViewBasePadding: 10px;
.edit {
.cardDetailToolbar {
&.commands {
div, ul {
display: none;
visibility: hidden;
}
}
}
}
.cardDetailToolbar { .cardDetailToolbar {
&.edit { &.edit {