mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-07-13 09:33:27 +00:00
FIX: Click not opening query (#191)
Due to recent core changes for Ember in0221855ba7
and952b033165
the correct way of calling these actions must be observed, otherwise clicking on a query did nothing. This commit fixes the click and also makes scrollTop work with the new {{on X}} Ember syntax.
This commit is contained in:
parent
0deecbe2ae
commit
bf1a79c9ad
@ -3,7 +3,10 @@ import showModal from "discourse/lib/show-modal";
|
|||||||
import Query from "discourse/plugins/discourse-data-explorer/discourse/models/query";
|
import Query from "discourse/plugins/discourse-data-explorer/discourse/models/query";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import discourseComputed, { observes } from "discourse-common/utils/decorators";
|
import discourseComputed, {
|
||||||
|
bind,
|
||||||
|
observes,
|
||||||
|
} from "discourse-common/utils/decorators";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import { Promise } from "rsvp";
|
import { Promise } from "rsvp";
|
||||||
import { inject as service } from "@ember/service";
|
import { inject as service } from "@ember/service";
|
||||||
@ -165,6 +168,12 @@ export default Controller.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@bind
|
||||||
|
scrollTop() {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
this.setProperties({ editing: false, everEditing: false });
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
dummy() {},
|
dummy() {},
|
||||||
|
|
||||||
@ -207,11 +216,6 @@ export default Controller.extend({
|
|||||||
window.open(this.get("selectedItem.downloadUrl"), "_blank");
|
window.open(this.get("selectedItem.downloadUrl"), "_blank");
|
||||||
},
|
},
|
||||||
|
|
||||||
scrollTop() {
|
|
||||||
window.scrollTo(0, 0);
|
|
||||||
this.setProperties({ editing: false, everEditing: false });
|
|
||||||
},
|
|
||||||
|
|
||||||
goHome() {
|
goHome() {
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
asc: null,
|
asc: null,
|
||||||
|
@ -346,7 +346,7 @@
|
|||||||
<tr class="query-row">
|
<tr class="query-row">
|
||||||
<td>
|
<td>
|
||||||
<a
|
<a
|
||||||
{{action "scrollTop"}}
|
{{on "click" this.scrollTop}}
|
||||||
href="/admin/plugins/explorer/?id={{query.id}}"
|
href="/admin/plugins/explorer/?id={{query.id}}"
|
||||||
>
|
>
|
||||||
<b class="query-name">{{query.name}}</b>
|
<b class="query-name">{{query.name}}</b>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user