mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 22:42:19 +00:00
REFACTOR: Remove deprecated action="something"
attributes
In newer versions of Ember, `this.sendAction` is deprecated: https://deprecations.emberjs.com/v3.x/#toc_ember-component-send-action This patch removes most of our current uses (via `d-button`) but also some other rogue `this.sendAction` calls too.
This commit is contained in:
parent
da0dea1e94
commit
3d6d3e6cb1
@ -94,6 +94,8 @@ export default Component.extend({
|
|||||||
|
|
||||||
if (action) {
|
if (action) {
|
||||||
if (typeof action === "string") {
|
if (typeof action === "string") {
|
||||||
|
// Note: This is deprecated in new Embers and needs to be removed in the future.
|
||||||
|
// There is already a warning in the console.
|
||||||
this.sendAction("action", this.actionParam);
|
this.sendAction("action", this.actionParam);
|
||||||
} else if (typeof action === "object" && action.value) {
|
} else if (typeof action === "object" && action.value) {
|
||||||
action.value(this.actionParam);
|
action.value(this.actionParam);
|
||||||
|
@ -74,7 +74,7 @@ export default Component.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
deleteTag() {
|
deleteTag() {
|
||||||
this.sendAction("deleteAction", this.tagInfo);
|
this.deleteAction(this.tagInfo);
|
||||||
},
|
},
|
||||||
|
|
||||||
unlinkSynonym(tag) {
|
unlinkSynonym(tag) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{{#if visible}}
|
{{#if visible}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="banner" class={{overlay}}>
|
<div id="banner" class={{overlay}}>
|
||||||
{{d-button icon="times" action="dismiss" class="btn btn-flat close" title="banner.close"}}
|
{{d-button icon="times" action=(action "dismiss") class="btn btn-flat close" title="banner.close"}}
|
||||||
<div id="banner-content">
|
<div id="banner-content">
|
||||||
{{html-safe content}}
|
{{html-safe content}}
|
||||||
{{#if currentUser.staff}}
|
{{#if currentUser.staff}}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{{d-button
|
{{d-button
|
||||||
icon="times"
|
icon="times"
|
||||||
action="dismiss"
|
action=(action "dismiss")
|
||||||
class="btn btn-flat close" title="banner.close"
|
class="btn btn-flat close" title="banner.close"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{{d-button
|
{{d-button
|
||||||
icon="times"
|
icon="times"
|
||||||
action="dismiss"
|
action=(action "dismiss")
|
||||||
class="btn btn-flat close"
|
class="btn btn-flat close"
|
||||||
title="banner.close"
|
title="banner.close"
|
||||||
}}
|
}}
|
||||||
|
@ -34,6 +34,11 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{d-button action="close" class="btn btn-flat close" icon="times" aria-label="share.close" title="share.close"}}
|
{{d-button action=(action "close")
|
||||||
|
class="btn btn-flat close"
|
||||||
|
icon="times"
|
||||||
|
aria-label="share.close"
|
||||||
|
title="share.close"
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user