Merge pull request #5476 from Zlash65/user-tags

[Minor] User tags fix and refresh list
This commit is contained in:
Prateeksha Singh 2018-04-21 14:25:08 +05:30 committed by GitHub
commit 30e1bb5df7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -468,15 +468,19 @@ frappe.views.ListSidebar = Class.extend({
.on("click", ".stat-link", function() {
var fieldname = $(this).attr('data-field');
var label = $(this).attr('data-label');
if (label == "No Tags") {
label = "%,%";
}
var condition = "like";
var existing = me.list_view.filter_area.filter_list.get_filter(fieldname);
if(existing) {
existing.remove();
}
me.list_view.filter_area.filter_list.add_filter(me.list_view.doctype, fieldname, 'not like', label);
me.list_view.refresh();
if (label == "No Tags") {
label = "%,%";
condition = "not like";
}
me.list_view.filter_area.filter_list.add_filter(me.list_view.doctype, fieldname, condition, label)
.then(function() {
me.list_view.refresh();
});
})
.insertBefore(this.sidebar.find(".close-sidebar-button"));
},