Browse Source

[design] modal animate

version-14
Anand Doshi 10 years ago
parent
commit
c22af0798a
7 changed files with 26 additions and 7 deletions
  1. +2
    -0
      frappe/public/css/sidebar.css
  2. +4
    -4
      frappe/public/js/frappe/dom.js
  3. +6
    -1
      frappe/public/js/frappe/form/form_sidebar.html
  4. +1
    -1
      frappe/public/js/frappe/ui/modal.html
  5. +1
    -1
      frappe/public/js/frappe/ui/tags.js
  6. +10
    -0
      frappe/public/js/frappe/views/container.js
  7. +2
    -0
      frappe/public/less/sidebar.less

+ 2
- 0
frappe/public/css/sidebar.css View File

@@ -38,6 +38,7 @@ body[data-route^="Module"] .main-menu .form-sidebar {
}
.offcanvas .sidebar .badge {
right: 15px !important;
top: 11px !important;
}
.offcanvas .sidebar .sidebar-menu > li > a:hover,
.offcanvas .sidebar .sidebar-menu > li > a:focus,
@@ -70,6 +71,7 @@ body[data-route^="Module"] .main-menu .form-sidebar {
position: absolute;
font-weight: normal;
right: 0px;
top: 0px;
padding-bottom: 4px;
}
.sidebar-menu .octicon {


+ 4
- 4
frappe/public/js/frappe/dom.js View File

@@ -62,7 +62,7 @@ frappe.dom = {
freeze: function() {
// blur
if(!$('#freeze').length) {
$("<div id='freeze' class='modal-backdrop' style='display: none;'>")
$("<div id='freeze' class='modal-backdrop fade' style='display: none;'>")
.on("click", function() {
if (cur_frm && cur_frm.cur_grid) {
cur_frm.cur_grid.toggle_view();
@@ -71,14 +71,14 @@ frappe.dom = {
})
.appendTo("#body_div");
}
$('#freeze').fadeIn();
$('#freeze').toggle(true).addClass("in");
frappe.dom.freeze_count++;
},
unfreeze: function() {
unfreeze: function(fade) {
if(!frappe.dom.freeze_count)return; // anything open?
frappe.dom.freeze_count--;
if(!frappe.dom.freeze_count) {
$('#freeze').fadeOut();
$('#freeze').removeClass("in").toggle(false);
}
},
save_selection: function() {


+ 6
- 1
frappe/public/js/frappe/form/form_sidebar.html View File

@@ -3,7 +3,12 @@
</ul>
<ul class="list-unstyled sidebar-menu">
<li class="divider"></li>
<li><a class="strong sidebar-comments badge-hover">{%= __("Comments") %} <span class="pull-right badge n-comments">0</span></a></li>
<li style="position: relative;">
<a class="strong sidebar-comments badge-hover">
<span>{%= __("Comments") %}</span>
<span class="badge n-comments">0</span>
</a>
</li>
</ul>
<ul class="list-unstyled sidebar-menu form-assignments">
<li class="divider"></li>


+ 1
- 1
frappe/public/js/frappe/ui/modal.html View File

@@ -1,4 +1,4 @@
<div class="modal" style="overflow: auto;" tabindex="-1">
<div class="modal fade" style="overflow: auto;" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">


+ 1
- 1
frappe/public/js/frappe/ui/tags.js View File

@@ -17,7 +17,7 @@ frappe.ui.TagEditor = Class.extend({
this.$tags = $('<ul>').prependTo(this.$w).tagit({
animate: false,
allowSpaces: true,
placeholderText: __('Type to tag' + "..."),
placeholderText: __('Add a tag' + "..."),
onTagAdded: function(ev, tag) {
if(me.initialized && !me.refreshing) {
var tag = tag.find('.tagit-label').text();


+ 10
- 0
frappe/public/js/frappe/views/container.js View File

@@ -19,6 +19,10 @@ frappe.views.Container = Class.extend({
// set data-route in body
$("body").attr("data-route", frappe.get_route_str());
});

$(document).bind('rename', function(event, dt, old_name, new_name) {
me.rename_breadcrumbs(dt, old_name, new_name)
});
},
add_page: function(label) {
var page = $('<div class="content page-container"></div>')
@@ -100,6 +104,12 @@ frappe.views.Container = Class.extend({
{doctype: breadcrumbs.doctype, label: __(breadcrumbs.doctype)}))
.appendTo($breadcrumbs);
}
},
rename_breadcrumbs: function(doctype, old_name, new_name) {
var old_route_str = frappe.get_route_str(["Form", doctype, old_name]);
var new_route_str = frappe.get_route_str(["Form", doctype, new_name]);
frappe.breadcrumbs[new_route_str] = frappe.breadcrumbs[old_route_str];
delete frappe.breadcrumbs[old_route_str];
}
});



+ 2
- 0
frappe/public/less/sidebar.less View File

@@ -53,6 +53,7 @@ body[data-route^="Module"] .main-menu {

.badge {
right: 15px !important;
top: 11px !important;
}
}

@@ -96,6 +97,7 @@ body[data-route^="Module"] .main-menu {
position: absolute;
font-weight: normal;
right: 0px;
top: 0px;
padding-bottom: 4px;
}



Loading…
Cancel
Save