Browse Source

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

version-14
Faris Ansari 8 years ago
committed by Rushabh Mehta
parent
commit
c3bb5930f7
4 changed files with 8 additions and 24 deletions
  1. +0
    -8
      frappe/public/css/mobile.css
  2. +0
    -7
      frappe/public/js/frappe/ui/dialog.js
  3. +8
    -0
      frappe/public/js/frappe/ui/toolbar/toolbar.js
  4. +0
    -9
      frappe/public/less/mobile.less

+ 0
- 8
frappe/public/css/mobile.css View File

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


+ 0
- 7
frappe/public/js/frappe/ui/dialog.js View File

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


+ 8
- 0
frappe/public/js/frappe/ui/toolbar/toolbar.js View File

@@ -26,6 +26,14 @@ frappe.ui.toolbar.Toolbar = Class.extend({
$("header .navbar .custom-menu").remove(); $("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(); frappe.search.setup();
}, },




+ 0
- 9
frappe/public/less/mobile.less View File

@@ -232,21 +232,12 @@ body {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
width: 100%; width: 100%;
height: 100%;

position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
overflow-y: auto;
background-color: #fff; background-color: #fff;
} }


.modal-content { .modal-content {
border-radius: 0px; border-radius: 0px;
border: none; border: none;
box-shadow: none;
height: 100%; height: 100%;
} }




Loading…
Cancel
Save