ソースを参照

[minor] on click of sidebar comments, scroll to comments

version-14
Anand Doshi 10年前
コミット
ac8f58ab7e
4個のファイルの変更12行の追加1行の削除
  1. +3
    -0
      frappe/public/css/desk.css
  2. +1
    -1
      frappe/public/js/frappe/form/form_sidebar.html
  3. +4
    -0
      frappe/public/js/frappe/form/sidebar.js
  4. +4
    -0
      frappe/public/less/desk.less

+ 3
- 0
frappe/public/css/desk.css ファイルの表示

@@ -387,6 +387,9 @@ em.link-option {
.sidebar-section h6 .label { .sidebar-section h6 .label {
font-size: 12px; font-size: 12px;
} }
.sidebar-section.sidebar-comments {
cursor: pointer;
}
.user-actions { .user-actions {
margin-bottom: 15px; margin-bottom: 15px;
} }


+ 1
- 1
frappe/public/js/frappe/form/form_sidebar.html ファイルの表示

@@ -2,7 +2,7 @@
<ul class="sidebar-section user-actions list-unstyled hide"> <ul class="sidebar-section user-actions list-unstyled hide">
</ul> </ul>
{% if (!frm.meta.hide_toolbar) { %} {% if (!frm.meta.hide_toolbar) { %}
<div class="sidebar-section">
<div class="sidebar-section sidebar-comments">
<h6>{%= __("Comments") %} <h6>{%= __("Comments") %}
<span class="label label-default n-comments"></span></h6> <span class="label label-default n-comments"></span></h6>
</div> </div>


+ 4
- 0
frappe/public/js/frappe/form/sidebar.js ファイルの表示

@@ -2,11 +2,15 @@ frappe.provide("frappe.ui.form");
frappe.ui.form.Sidebar = Class.extend({ frappe.ui.form.Sidebar = Class.extend({
init: function(opts) { init: function(opts) {
$.extend(this, opts); $.extend(this, opts);
var me = this;
this.parent.addClass("hidden-xs"); this.parent.addClass("hidden-xs");
this.wrapper = $(frappe.render_template("form_sidebar", this.wrapper = $(frappe.render_template("form_sidebar",
{doctype: this.frm.doctype, frm:this.frm})) {doctype: this.frm.doctype, frm:this.frm}))
.appendTo(this.parent); .appendTo(this.parent);
this.$user_actions = this.wrapper.find(".user-actions"); this.$user_actions = this.wrapper.find(".user-actions");
this.wrapper.find(".sidebar-section.sidebar-comments").on("click", function() {
$(window).scrollTop(me.frm.footer.wrapper.find(".form-comments").offset().top);
});
}, },
add_user_action: function(label, click) { add_user_action: function(label, click) {
$('<a>').html(label).appendTo($('<li>') $('<a>').html(label).appendTo($('<li>')


+ 4
- 0
frappe/public/less/desk.less ファイルの表示

@@ -465,6 +465,10 @@ em.link-option {
font-size: 12px; font-size: 12px;
} }


.sidebar-section.sidebar-comments {
cursor: pointer;
}

.user-actions { .user-actions {
margin-bottom: 15px; margin-bottom: 15px;
} }


読み込み中…
キャンセル
保存