mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 17:06:31 -06:00
Ember.empty
has been renamed to Ember.isEmpty
This commit is contained in:
parent
eb14a6d294
commit
61101736cb
@ -4,7 +4,7 @@ export default Ember.ObjectController.extend({
|
||||
|
||||
saveDisabled: function() {
|
||||
if (this.get('saving')) { return true; }
|
||||
if ((!this.get('allow_blank')) && Ember.empty(this.get('value'))) { return true; }
|
||||
if ((!this.get('allow_blank')) && Ember.isEmpty(this.get('value'))) { return true; }
|
||||
return false;
|
||||
}.property('saving', 'value'),
|
||||
|
||||
|
@ -50,7 +50,7 @@ export default Ember.ObjectController.extend(BufferedContent, {
|
||||
|
||||
cancel: function() {
|
||||
var id = this.get('id');
|
||||
if (Ember.empty(id)) {
|
||||
if (Ember.isEmpty(id)) {
|
||||
this.get('controllers.admin-user-fields').send('destroy', this.get('model'));
|
||||
} else {
|
||||
this.rollbackBuffer();
|
||||
|
@ -19,7 +19,7 @@ export default ObjectController.extend(CanCheckEmails, {
|
||||
var siteUserFields = this.site.get('user_fields'),
|
||||
userFields = this.get('user_fields');
|
||||
|
||||
if (!Ember.empty(siteUserFields)) {
|
||||
if (!Ember.isEmpty(siteUserFields)) {
|
||||
return siteUserFields.map(function(uf) {
|
||||
var value = userFields ? userFields[uf.get('id').toString()] : null;
|
||||
return {name: uf.get('name'), value: value};
|
||||
|
@ -21,7 +21,7 @@ export default DiscourseController.extend({
|
||||
var usernames = this.get('model.targetUsernames');
|
||||
|
||||
// We need exactly one user to issue a warning
|
||||
if (Em.empty(usernames) || usernames.split(',').length !== 1) {
|
||||
if (Ember.isEmpty(usernames) || usernames.split(',').length !== 1) {
|
||||
return false;
|
||||
}
|
||||
return this.get('model.creatingPrivateMessage');
|
||||
|
@ -51,10 +51,10 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||
// Validate required fields
|
||||
var userFields = this.get('userFields');
|
||||
if (userFields) { userFields = userFields.filterProperty('field.required'); }
|
||||
if (!Ember.empty(userFields)) {
|
||||
if (!Ember.isEmpty(userFields)) {
|
||||
var anyEmpty = userFields.any(function(uf) {
|
||||
var val = uf.get('value');
|
||||
return !val || Ember.empty(val);
|
||||
return !val || Ember.isEmpty(val);
|
||||
});
|
||||
if (anyEmpty) { return true; }
|
||||
}
|
||||
@ -336,7 +336,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||
userFields = this.get('userFields');
|
||||
|
||||
// Add the userfields to the data
|
||||
if (!Em.empty(userFields)) {
|
||||
if (!Ember.isEmpty(userFields)) {
|
||||
attrs.userFields = {};
|
||||
userFields.forEach(function(f) {
|
||||
attrs.userFields[f.get('field.id')] = f.get('value');
|
||||
|
@ -20,7 +20,7 @@ export default ObjectController.extend(CanCheckEmails, {
|
||||
|
||||
userFields: function() {
|
||||
var siteUserFields = this.site.get('user_fields');
|
||||
if (!Ember.empty(siteUserFields)) {
|
||||
if (!Ember.isEmpty(siteUserFields)) {
|
||||
var userFields = this.get('user_fields');
|
||||
return siteUserFields.filterProperty('editable', true).sortBy('field_type').map(function(uf) {
|
||||
var val = userFields ? userFields[uf.get('id').toString()] : null;
|
||||
@ -85,9 +85,9 @@ export default ObjectController.extend(CanCheckEmails, {
|
||||
userFields = this.get('userFields');
|
||||
|
||||
// Update the user fields
|
||||
if (!Em.empty(userFields)) {
|
||||
if (!Ember.isEmpty(userFields)) {
|
||||
var modelFields = model.get('user_fields');
|
||||
if (!Em.empty(modelFields)) {
|
||||
if (!Ember.isEmpty(modelFields)) {
|
||||
userFields.forEach(function(uf) {
|
||||
modelFields[uf.get('field.id').toString()] = uf.get('value');
|
||||
});
|
||||
|
@ -3,7 +3,7 @@ import BadgeSelectController from "discourse/mixins/badge-select-controller";
|
||||
export default Ember.ArrayController.extend(BadgeSelectController, {
|
||||
filteredList: function() {
|
||||
return this.get('model').filter(function(b) {
|
||||
return !Em.empty(b.get('badge.image'));
|
||||
return !Ember.isEmpty(b.get('badge.image'));
|
||||
});
|
||||
}.property('model'),
|
||||
|
||||
|
@ -19,7 +19,7 @@ export default ObjectController.extend(Discourse.SelectedPostsCount, {
|
||||
|
||||
_titleChanged: function() {
|
||||
var title = this.get('title');
|
||||
if (!Em.empty(title)) {
|
||||
if (!Ember.isEmpty(title)) {
|
||||
|
||||
// Note normally you don't have to trigger this, but topic titles can be updated
|
||||
// and are sometimes lazily loaded.
|
||||
|
@ -1,5 +1,5 @@
|
||||
export default Ember.Handlebars.makeBoundHelper(function(str) {
|
||||
if (Em.empty(str)) { return ""; }
|
||||
if (Ember.isEmpty(str)) { return ""; }
|
||||
|
||||
if (str.indexOf('fa-') === 0) {
|
||||
return new Handlebars.SafeString("<i class='fa " + str + "'></i>");
|
||||
|
@ -10,7 +10,7 @@ export default Discourse.View.extend(StringBuffer, {
|
||||
}.property('helpKey', 'textKey'),
|
||||
|
||||
text: function() {
|
||||
if (Em.empty(this.get('textKey'))) { return ""; }
|
||||
if (Ember.isEmpty(this.get('textKey'))) { return ""; }
|
||||
return I18n.t(this.get('textKey'));
|
||||
}.property('textKey'),
|
||||
|
||||
|
@ -46,7 +46,7 @@ export default ComboboxView.extend({
|
||||
var category;
|
||||
|
||||
// If we have no id, but text with the uncategorized name, we can use that badge.
|
||||
if (Em.empty(item.id)) {
|
||||
if (Ember.isEmpty(item.id)) {
|
||||
var uncat = Discourse.Category.findUncategorized();
|
||||
if (uncat && uncat.get('name') === item.text) {
|
||||
category = uncat;
|
||||
|
@ -16,7 +16,7 @@ export default Discourse.View.extend(CleansUp, {
|
||||
var $this = this.$();
|
||||
if (!$this) { return; }
|
||||
|
||||
if (Ember.empty(url)) {
|
||||
if (Ember.isEmpty(url)) {
|
||||
$this.css('background-image', '').addClass('no-bg');
|
||||
} else {
|
||||
$this.css('background-image', "url(" + url + ")").removeClass('no-bg');
|
||||
|
Loading…
Reference in New Issue
Block a user