mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
Timeline Title for small resolution Add to knowledge base button. (#9926)
* Add to Knowledge Base button class updated to hide for mobile view. * Updated code to avoid multiple occurance of Knowledge Base button while updating comment.
This commit is contained in:
@@ -20,9 +20,11 @@ frappe.ui.form.on("Issue", {
|
|||||||
timeline_refresh: function(frm) {
|
timeline_refresh: function(frm) {
|
||||||
// create button for "Add to Knowledge Base"
|
// create button for "Add to Knowledge Base"
|
||||||
if(frappe.model.can_create('Help Article')) {
|
if(frappe.model.can_create('Help Article')) {
|
||||||
$('<button class="btn btn-xs btn-default btn-add-to-kb pull-right" style="margin-top: -2px">'+
|
// Removing Knowledge Base button if exists to avoid multiple occurance
|
||||||
|
frm.timeline.wrapper.find('.comment-header .asset-details .btn-add-to-kb').remove();
|
||||||
|
$('<button class="btn btn-xs btn-default btn-add-to-kb hidden-xs pull-right" style="margin-top: -2px">'+
|
||||||
__('Add to Knowledge Base') + '</button>')
|
__('Add to Knowledge Base') + '</button>')
|
||||||
.appendTo(frm.timeline.wrapper.find('.comment-header'))
|
.appendTo(frm.timeline.wrapper.find('.comment-header .asset-details'))
|
||||||
.on('click', function() {
|
.on('click', function() {
|
||||||
var content = $(this).parents('.timeline-item:first').find('.timeline-item-content').html();
|
var content = $(this).parents('.timeline-item:first').find('.timeline-item-content').html();
|
||||||
var doc = frappe.model.get_new_doc('Help Article');
|
var doc = frappe.model.get_new_doc('Help Article');
|
||||||
|
|||||||
Reference in New Issue
Block a user