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 { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
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 { Promise } from "rsvp";
|
||||
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: {
|
||||
dummy() {},
|
||||
|
||||
|
@ -207,11 +216,6 @@ export default Controller.extend({
|
|||
window.open(this.get("selectedItem.downloadUrl"), "_blank");
|
||||
},
|
||||
|
||||
scrollTop() {
|
||||
window.scrollTo(0, 0);
|
||||
this.setProperties({ editing: false, everEditing: false });
|
||||
},
|
||||
|
||||
goHome() {
|
||||
this.setProperties({
|
||||
asc: null,
|
||||
|
|
|
@ -346,7 +346,7 @@
|
|||
<tr class="query-row">
|
||||
<td>
|
||||
<a
|
||||
{{action "scrollTop"}}
|
||||
{{on "click" this.scrollTop}}
|
||||
href="/admin/plugins/explorer/?id={{query.id}}"
|
||||
>
|
||||
<b class="query-name">{{query.name}}</b>
|
||||
|
|
Loading…
Reference in New Issue