mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 02:22:40 +08:00
DEV: global s/this.get\("(\w+)"\)/this.$1 (#7592)
This commit is contained in:
@ -15,13 +15,13 @@ export default Ember.Controller.extend({
|
||||
field_type: "text",
|
||||
position: MAX_FIELDS
|
||||
});
|
||||
this.get("model").pushObject(f);
|
||||
this.model.pushObject(f);
|
||||
},
|
||||
|
||||
moveUp(f) {
|
||||
const idx = this.get("sortedFields").indexOf(f);
|
||||
const idx = this.sortedFields.indexOf(f);
|
||||
if (idx) {
|
||||
const prev = this.get("sortedFields").objectAt(idx - 1);
|
||||
const prev = this.sortedFields.objectAt(idx - 1);
|
||||
const prevPos = prev.get("position");
|
||||
|
||||
prev.update({ position: f.get("position") });
|
||||
@ -30,9 +30,9 @@ export default Ember.Controller.extend({
|
||||
},
|
||||
|
||||
moveDown(f) {
|
||||
const idx = this.get("sortedFields").indexOf(f);
|
||||
const idx = this.sortedFields.indexOf(f);
|
||||
if (idx > -1) {
|
||||
const next = this.get("sortedFields").objectAt(idx + 1);
|
||||
const next = this.sortedFields.objectAt(idx + 1);
|
||||
const nextPos = next.get("position");
|
||||
|
||||
next.update({ position: f.get("position") });
|
||||
@ -41,7 +41,7 @@ export default Ember.Controller.extend({
|
||||
},
|
||||
|
||||
destroy(f) {
|
||||
const model = this.get("model");
|
||||
const model = this.model;
|
||||
|
||||
// Only confirm if we already been saved
|
||||
if (f.get("id")) {
|
||||
|
Reference in New Issue
Block a user