Przeglądaj źródła

[design] modal animate

version-14
Anand Doshi 10 lat temu
rodzic
commit
c22af0798a
7 zmienionych plików z 26 dodań i 7 usunięć
  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 Wyświetl plik

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


+ 4
- 4
frappe/public/js/frappe/dom.js Wyświetl plik

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


+ 6
- 1
frappe/public/js/frappe/form/form_sidebar.html Wyświetl plik

@@ -3,7 +3,12 @@
</ul> </ul>
<ul class="list-unstyled sidebar-menu"> <ul class="list-unstyled sidebar-menu">
<li class="divider"></li> <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>
<ul class="list-unstyled sidebar-menu form-assignments"> <ul class="list-unstyled sidebar-menu form-assignments">
<li class="divider"></li> <li class="divider"></li>


+ 1
- 1
frappe/public/js/frappe/ui/modal.html Wyświetl plik

@@ -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-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">


+ 1
- 1
frappe/public/js/frappe/ui/tags.js Wyświetl plik

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


+ 10
- 0
frappe/public/js/frappe/views/container.js Wyświetl plik

@@ -19,6 +19,10 @@ frappe.views.Container = Class.extend({
// set data-route in body // set data-route in body
$("body").attr("data-route", frappe.get_route_str()); $("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) { add_page: function(label) {
var page = $('<div class="content page-container"></div>') var page = $('<div class="content page-container"></div>')
@@ -100,6 +104,12 @@ frappe.views.Container = Class.extend({
{doctype: breadcrumbs.doctype, label: __(breadcrumbs.doctype)})) {doctype: breadcrumbs.doctype, label: __(breadcrumbs.doctype)}))
.appendTo($breadcrumbs); .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 Wyświetl plik

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


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


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




Ładowanie…
Anuluj
Zapisz