From 2484b8eb91e1dad5eb1cea4a1fb0c6ab50ca6e7f Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 8 Jul 2016 14:37:24 +0800 Subject: [PATCH] FIX: Show overriden checkbox not triggering search on check. --- .../admin/controllers/admin-site-text-index.js.es6 | 4 ++-- app/assets/javascripts/discourse/components/d-checkbox.js.es6 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 index d0298710b..0c770bd06 100644 --- a/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 @@ -45,9 +45,9 @@ export default Ember.Controller.extend({ this.transitionToRoute('adminSiteText.edit', siteText.get('id')); }, - search() { + search(overridden) { const q = this.get('q'); - if (q !== lastSearch) { + if (q !== lastSearch || overridden) { this.set('searching', true); Ember.run.debounce(this, this._performSearch, 400); lastSearch = q; diff --git a/app/assets/javascripts/discourse/components/d-checkbox.js.es6 b/app/assets/javascripts/discourse/components/d-checkbox.js.es6 index 217ec2c3a..bb15966c4 100644 --- a/app/assets/javascripts/discourse/components/d-checkbox.js.es6 +++ b/app/assets/javascripts/discourse/components/d-checkbox.js.es6 @@ -7,7 +7,7 @@ export default Ember.Component.extend({ _watchChanges() { // In Ember 13.3 we can use action on the checkbox `{{input}}` but not in 1.11 this.$('input').on('click.d-checkbox', () => { - Ember.run.scheduleOnce('afterRender', () => this.sendAction('change')); + Ember.run.scheduleOnce('afterRender', () => this.sendAction('change', true)); }); },