diff --git a/assets/javascripts/discourse/components/param-input.js.es6 b/assets/javascripts/discourse/components/param-input.js.es6 index f06896f..9d0a268 100644 --- a/assets/javascripts/discourse/components/param-input.js.es6 +++ b/assets/javascripts/discourse/components/param-input.js.es6 @@ -43,7 +43,14 @@ export default Ember.Component.extend({ this.get('params')[this.get('info.identifier')] = value.toString(); } return this.get('params')[this.get('info.identifier')]; - }.property('params', 'pname'), + }.property('params', 'info.identifier'), + + valueBool: function(key, value, previousValue) { + if (arguments.length > 1) { + this.get('params')[this.get('info.identifier')] = (!!value).toString(); + } + return this.get('params')[this.get('info.identifier')] !== 'false'; + }.property('params', 'info.identifier'), valid: function() { const type = this.get('info.type'), diff --git a/assets/javascripts/discourse/models/query.js.es6 b/assets/javascripts/discourse/models/query.js.es6 index a12f85d..51ee4ad 100644 --- a/assets/javascripts/discourse/models/query.js.es6 +++ b/assets/javascripts/discourse/models/query.js.es6 @@ -35,7 +35,10 @@ const Query = RestModel.extend({ if (oldParams[pinfo.identifier]) { newParams[name] = oldParams[name]; } else if (pinfo['default'] !== null) { + if (pinfo['default'] === false) { debugger; } newParams[name] = pinfo['default']; + } else if (pinfo['type'] === 'boolean') { + newParams[name] = 'false'; } else { newParams[name] = ''; } diff --git a/assets/javascripts/discourse/templates/admin/components/q-params/boolean.hbs b/assets/javascripts/discourse/templates/admin/components/q-params/boolean.hbs index fe27cf4..6031cd0 100644 --- a/assets/javascripts/discourse/templates/admin/components/q-params/boolean.hbs +++ b/assets/javascripts/discourse/templates/admin/components/q-params/boolean.hbs @@ -1,6 +1,6 @@ {{#if info.nullable}} {{combo-box valueAttribute="id" value=value nameProperty="name" content=boolTypes}} {{else}} - {{input type="checkbox" checked=value}} + {{input type="checkbox" checked=valueBool}} {{/if}} {{info.identifier}} diff --git a/assets/stylesheets/explorer.scss b/assets/stylesheets/explorer.scss index 0af683e..36516ea 100644 --- a/assets/stylesheets/explorer.scss +++ b/assets/stylesheets/explorer.scss @@ -171,6 +171,9 @@ overflow-x: visible; .ac-wrap { display: inline-block; + input { + width: 100px !important; // override an inline style + } } input { width: 190px;