DEV: Remove `d-checkbox` component

DEV: Remove d-checkbox component

Replaces the last occurrence of d-checkbox with a regular input element.

Includes a minor refactor of admin site text search.

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 a62c740..7ef5469 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
@@ -1,5 +1,4 @@
 let lastSearch;
-let lastOverridden;
 
 export default Ember.Controller.extend({
   searching: false,
@@ -8,7 +7,7 @@ export default Ember.Controller.extend({
   queryParams: ["q", "overridden"],
 
   q: null,
-  overridden: null,
+  overridden: false,
 
   _performSearch() {
     this.store
@@ -24,14 +23,18 @@ export default Ember.Controller.extend({
       this.transitionToRoute("adminSiteText.edit", siteText.get("id"));
     },
 
-    search(overridden) {
-      if (typeof overridden === "boolean") this.set("overridden", overridden);
+    toggleOverridden() {
+      this.toggleProperty("overridden");
+      this.set("searching", true);
+      Ember.run.debounce(this, this._performSearch, 400);
+    },
+
+    search() {
       const q = this.get("q");
-      if (q !== lastSearch || overridden !== lastOverridden) {
+      if (q !== lastSearch) {
         this.set("searching", true);
         Ember.run.debounce(this, this._performSearch, 400);
         lastSearch = q;
-        lastOverridden = overridden;
       }
     }
   }
diff --git a/app/assets/javascripts/admin/templates/site-text-index.hbs b/app/assets/javascripts/admin/templates/site-text-index.hbs
index c842333..78f2c17 100644
--- a/app/assets/javascripts/admin/templates/site-text-index.hbs
+++ b/app/assets/javascripts/admin/templates/site-text-index.hbs
@@ -8,7 +8,10 @@
                key-up=(action "search")}}
 
   <div class='extra-options'>
-    {{d-checkbox label="admin.site_text.show_overriden" checked=overridden change=(action "search")}}
+    <label>
+      {{input type="checkbox" checked=overridden click=(action "toggleOverridden")}}
+      {{i18n 'admin.site_text.show_overriden'}}
+    </label>
   </div>
 </div>
 
diff --git a/app/assets/javascripts/discourse/components/d-checkbox.js.es6 b/app/assets/javascripts/discourse/components/d-checkbox.js.es6
deleted file mode 100644
index 7bbb682..0000000
--- a/app/assets/javascripts/discourse/components/d-checkbox.js.es6
+++ /dev/null
@@ -1,25 +0,0 @@
-import { on } from "ember-addons/ember-computed-decorators";
-
-export default Ember.Component.extend({
-  tagName: "label",
-
-  @on("didInsertElement")
-  _init() {
-    const checked = this.get("checked");
-    if (checked && checked !== "false") {
-      this.$("input").prop("checked", true);
-    }
-
-    // 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.change(this.$("input").prop("checked"))
-      );
-    });
-  },
-
-  @on("willDestroyElement")
-  _clear() {
-    this.$("input").off("click.d-checkbox");
-  }
-});
diff --git a/app/assets/javascripts/discourse/templates/components/d-checkbox.hbs b/app/assets/javascripts/discourse/templates/components/d-checkbox.hbs
deleted file mode 100644
index 8ec5979..0000000
--- a/app/assets/javascripts/discourse/templates/components/d-checkbox.hbs
+++ /dev/null
@@ -1,2 +0,0 @@
-<input type='checkbox' disabled={{disabled}}>
-{{i18n label}}

GitHub sha: 74ed72e8