[style] grey bg for disabled inputs and fix for back button

This commit is contained in:
Rushabh Mehta 2017-03-15 13:03:52 +05:30
parent b5cfe518fa
commit 400dcd369e
5 changed files with 36 additions and 8 deletions

View file

@ -199,9 +199,6 @@ h6.uppercase,
.empty-section {
display: none !important;
}
.shaded-section {
background-color: #fafbfc;
}
.modal .form-layout {
margin: -15px;
}
@ -448,9 +445,16 @@ h6.uppercase,
}
.like-disabled-input {
margin-bottom: 7px;
border-radius: 3px;
min-height: 30px;
font-weight: bold;
background-color: #f5f7fa;
padding: 6px;
border-radius: 3px;
}
.disabled-check {
color: #f5f7fa;
margin-right: 3px;
margin-bottom: -2px;
}
.like-disabled-input.for-description {
font-weight: normal;

View file

@ -59,7 +59,7 @@ frappe.form.formatters = {
if(value) {
return '<i class="octicon octicon-check" style="margin-right: 3px;"></i>';
} else {
return '<i class="fa fa-square text-extra-muted" style="margin-right: 3px; margin-bottom: -2px;"></i>';
return '<i class="fa fa-square disabled-check"></i>';
}
},
Link: function(value, docfield, options, doc) {

View file

@ -29,8 +29,22 @@ frappe.views.ListFactory = frappe.views.Factory.extend({
on_show: function() {
var route = frappe.get_route();
var doctype = route[1];
var last_route = frappe.route_history.slice(-2)[0];
if (route[0] === 'List' && route.length === 2 && frappe.views.list_view[doctype]) {
frappe.views.list_view[doctype].load_last_view();
if(last_route && last_route[0]==='List' && last_route[1]===doctype) {
// last route same as this route, so going back.
// this happens because #List/Item will redirect to #List/Item/List
// while coming from back button, the last 2 routes will be same, so
// we know user is coming in the reverse direction (via back button)
// example:
// Step 1: #List/Item redirects to #List/Item/List
// Step 2: User hits "back" comes back to #List/Item
// Step 3: Now we cannot send the user back to #List/Item/List so go back one more step
window.history.go(-1);
} else {
frappe.views.list_view[doctype].load_last_view();
}
}
},
show: function () {
@ -235,7 +249,7 @@ frappe.views.ListView = frappe.ui.BaseList.extend({
this.list_header = this.page.main.find('.list-headers > '
+ '.list-row-head[data-list-renderer="'
+ this.list_renderer.name +'"]');
if(this.list_header.length > 0) {
this.list_header.show();
return;

View file

@ -257,7 +257,7 @@ h6.uppercase, .h6.uppercase {
}
.shaded-section {
background-color: @light-bg;
//background-color: @light-bg;
}
.modal {
@ -568,6 +568,15 @@ h6.uppercase, .h6.uppercase {
border-radius: 3px;
min-height: 30px;
font-weight: bold;
background-color: @navbar-bg;
padding: 6px;
border-radius: 3px;
}
.disabled-check {
color: @navbar-bg;
margin-right: 3px;
margin-bottom: -2px;
}
.like-disabled-input.for-description {

View file

@ -8,6 +8,7 @@
@btn-bg: #F0F4F7;
@panel-bg: #F7FAFC;
@grey-link-color: #212a33;
@disabled-background: #f2f5f7;
@navbar-bg: #f5f7fa;
@light-bg: #fafbfc;
@modal-backdrop-bg: #334143;