[mobile-ui] small modal, focus awesome bar (#2153)

This commit is contained in:
Faris Ansari 2016-10-06 17:17:43 +05:30 committed by Rushabh Mehta
parent c0d7b5b441
commit c3bb5930f7
4 changed files with 8 additions and 24 deletions

View file

@ -198,19 +198,11 @@ body {
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
overflow-y: auto;
background-color: #fff;
}
.modal .modal-content {
border-radius: 0px;
border: none;
box-shadow: none;
height: 100%;
}
.modal .modal-body .form-layout {

View file

@ -38,9 +38,6 @@ frappe.ui.Dialog = frappe.ui.FieldGroup.extend({
var me = this;
this.$wrapper
.on("hide.bs.modal", function() {
if(me.body_hidden) {
$("#body_div").toggle(true);
}
me.display = false;
if(frappe.ui.open_dialogs[frappe.ui.open_dialogs.length-1]===me) {
frappe.ui.open_dialogs.pop();
@ -54,10 +51,6 @@ frappe.ui.Dialog = frappe.ui.FieldGroup.extend({
})
.on("shown.bs.modal", function() {
// focus on first input
if(frappe.is_mobile()) {
$("#body_div").toggle(false);
me.body_hidden = true;
}
me.display = true;
cur_dialog = me;
frappe.ui.open_dialogs.push(me);

View file

@ -26,6 +26,14 @@ frappe.ui.toolbar.Toolbar = Class.extend({
$("header .navbar .custom-menu").remove();
});
//focus search-modal on show in mobile view
$('#search-modal').on('shown.bs.modal', function () {
var search_modal = $(this);
setTimeout(function() {
search_modal.find('#modal-search').focus();
}, 300);
});
frappe.search.setup();
},

View file

@ -232,21 +232,12 @@ body {
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
overflow-y: auto;
background-color: #fff;
}
.modal-content {
border-radius: 0px;
border: none;
box-shadow: none;
height: 100%;
}