[minor] on click of sidebar comments, scroll to comments
This commit is contained in:
parent
e94785b403
commit
ac8f58ab7e
4 changed files with 12 additions and 1 deletions
|
|
@ -387,6 +387,9 @@ em.link-option {
|
|||
.sidebar-section h6 .label {
|
||||
font-size: 12px;
|
||||
}
|
||||
.sidebar-section.sidebar-comments {
|
||||
cursor: pointer;
|
||||
}
|
||||
.user-actions {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<ul class="sidebar-section user-actions list-unstyled hide">
|
||||
</ul>
|
||||
{% if (!frm.meta.hide_toolbar) { %}
|
||||
<div class="sidebar-section">
|
||||
<div class="sidebar-section sidebar-comments">
|
||||
<h6>{%= __("Comments") %}
|
||||
<span class="label label-default n-comments"></span></h6>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,15 @@ frappe.provide("frappe.ui.form");
|
|||
frappe.ui.form.Sidebar = Class.extend({
|
||||
init: function(opts) {
|
||||
$.extend(this, opts);
|
||||
var me = this;
|
||||
this.parent.addClass("hidden-xs");
|
||||
this.wrapper = $(frappe.render_template("form_sidebar",
|
||||
{doctype: this.frm.doctype, frm:this.frm}))
|
||||
.appendTo(this.parent);
|
||||
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) {
|
||||
$('<a>').html(label).appendTo($('<li>')
|
||||
|
|
|
|||
|
|
@ -465,6 +465,10 @@ em.link-option {
|
|||
font-size: 12px;
|
||||
}
|
||||
|
||||
.sidebar-section.sidebar-comments {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.user-actions {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue