FIX: Allow closing the category dropdown when clicking on the same
category
This commit is contained in:
parent
634b769cda
commit
0c45cf1ee7
|
@ -69,10 +69,6 @@ Discourse.CategoryDropComponent = Ember.Component.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
categoryChanged: function() {
|
|
||||||
this.close();
|
|
||||||
}.observes('category', 'parentCategory'),
|
|
||||||
|
|
||||||
close: function() {
|
close: function() {
|
||||||
$('html').off('click.category-drop');
|
$('html').off('click.category-drop');
|
||||||
this.$('a[data-drop-close]').off('click.category-drop');
|
this.$('a[data-drop-close]').off('click.category-drop');
|
||||||
|
|
|
@ -50,7 +50,7 @@ Discourse.HTML = {
|
||||||
restricted = Em.get(category, 'read_restricted'),
|
restricted = Em.get(category, 'read_restricted'),
|
||||||
html = "<a href=\"" + Discourse.getURL("/category/") + Discourse.Category.slugFor(category) + "\" ";
|
html = "<a href=\"" + Discourse.getURL("/category/") + Discourse.Category.slugFor(category) + "\" ";
|
||||||
|
|
||||||
html += "class=\"badge-category" + (restricted ? ' restricted' : '' ) + "\" ";
|
html += "data-drop-close=\"true\" class=\"badge-category" + (restricted ? ' restricted' : '' ) + "\" ";
|
||||||
|
|
||||||
// Add description if we have it
|
// Add description if we have it
|
||||||
if (description) html += "title=\"" + Handlebars.Utils.escapeExpression(description) + "\" ";
|
if (description) html += "title=\"" + Handlebars.Utils.escapeExpression(description) + "\" ";
|
||||||
|
|
Loading…
Reference in New Issue