diff --git a/assets/javascripts/discourse/components/hljs-code-view.js.es6 b/assets/javascripts/discourse/components/hljs-code-view.js.es6 index 2cd2e9f..24e1083 100644 --- a/assets/javascripts/discourse/components/hljs-code-view.js.es6 +++ b/assets/javascripts/discourse/components/hljs-code-view.js.es6 @@ -1,18 +1,19 @@ import debounce from 'discourse/lib/debounce'; import highlightSyntax from 'discourse/lib/highlight-syntax'; +import { bufferedRender } from 'discourse-common/lib/buffered-render'; -export default Ember.Component.extend({ - render(buffer) { +export default Ember.Component.extend(bufferedRender({ + buildBuffer(buffer) { buffer.push("
");
buffer.push(Handlebars.Utils.escapeExpression(this.get('value')));
buffer.push("
");
},
_refreshHighlight: debounce(function() {
- this.rerender();
+ this.rerenderBuffer();
}, 50).observes('value'),
_applyHighlight: function() {
highlightSyntax(this.$());
}.on('didInsertElement')
-});
+}));
diff --git a/assets/javascripts/discourse/components/param-input.js.es6 b/assets/javascripts/discourse/components/param-input.js.es6
index 56356df..0601419 100644
--- a/assets/javascripts/discourse/components/param-input.js.es6
+++ b/assets/javascripts/discourse/components/param-input.js.es6
@@ -38,19 +38,26 @@ export default Ember.Component.extend({
boolTypes: [ {name: I18n.t('explorer.types.bool.true'), id: 'Y'}, {name: I18n.t('explorer.types.bool.false'), id: 'N'}, {name: I18n.t('explorer.types.bool.null_'), id: '#null'} ],
- value: function(key, value, previousValue) {
- if (arguments.length > 1) {
+ value: Ember.computed('params', 'info.identifier', {
+ get() {
+ return this.get('params')[this.get('info.identifier')];
+ },
+ set(key, value) {
this.get('params')[this.get('info.identifier')] = value.toString();
+ return value;
}
- return this.get('params')[this.get('info.identifier')];
- }.property('params', 'info.identifier'),
+ }),
- valueBool: function(key, value, previousValue) {
- if (arguments.length > 1) {
- this.get('params')[this.get('info.identifier')] = (!!value).toString();
+ valueBool: Ember.computed('params', 'info.identifier', {
+ get() {
+ return this.get('params')[this.get('info.identifier')] !== 'false';
+ },
+ set(key, value) {
+ value = !!value;
+ this.get('params')[this.get('info.identifier')] = value.toString();
+ return value;
}
- 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/components/query-result.js.es6 b/assets/javascripts/discourse/components/query-result.js.es6
index 85b9d6a..6005611 100644
--- a/assets/javascripts/discourse/components/query-result.js.es6
+++ b/assets/javascripts/discourse/components/query-result.js.es6
@@ -1,5 +1,6 @@
import { ajax } from 'discourse/lib/ajax';
import Badge from 'discourse/models/badge';
+import { getOwner } from 'discourse-common/lib/get-owner';
function randomIdShort() {
return 'xxxxxxxx'.replace(/[xy]/g, function() {
@@ -66,7 +67,7 @@ const QueryResultComponent = Ember.Component.extend({
}.property('content', 'columns.@each'),
fallbackTemplate: function() {
- return this.container.lookup('template:explorer/text.raw');
+ return getOwner(this).lookup('template:explorer/text.raw');
}.property(),
columnTemplates: function() {
@@ -79,7 +80,8 @@ const QueryResultComponent = Ember.Component.extend({
if (self.get('content.colrender')[idx]) {
viewName = self.get('content.colrender')[idx];
}
- return {name: viewName, template: self.container.lookup('template:explorer/' + viewName + '.raw')};
+ const template = getOwner(self).lookup('template:explorer/' + viewName + '.raw');
+ return {name: viewName, template };
});
}.property('content', 'columns.@each'),
diff --git a/assets/javascripts/discourse/components/query-row-content.js.es6 b/assets/javascripts/discourse/components/query-row-content.js.es6
index b720a75..420cde1 100644
--- a/assets/javascripts/discourse/components/query-row-content.js.es6
+++ b/assets/javascripts/discourse/components/query-row-content.js.es6
@@ -1,7 +1,6 @@
-
-
import { categoryLinkHTML } from 'discourse/helpers/category-link';
import { autoUpdatingRelativeAge } from 'discourse/lib/formatter';
+import { bufferedRender } from 'discourse-common/lib/buffered-render';
function icon_or_image_replacement(str, ctx) {
str = Ember.get(ctx.contexts[0], str);
@@ -28,10 +27,10 @@ function bound_date_replacement(str, ctx) {
const esc = Handlebars.Utils.escapeExpression;
-const QueryRowContentComponent = Ember.Component.extend({
+const QueryRowContentComponent = Ember.Component.extend(bufferedRender({
tagName: "tr",
- render: function(buffer) {
+ buildBuffer(buffer) {
const self = this;
const row = this.get('row');
const parent = self.get('parent');
@@ -76,6 +75,6 @@ const QueryRowContentComponent = Ember.Component.extend({
buffer.push("