MDL-54687 core_message: fixed lint errors

This commit is contained in:
Mark Nelson 2016-08-11 15:29:53 +08:00
parent d9fad93dc5
commit 2be15a66c4
5 changed files with 32 additions and 19 deletions

View File

@ -92,10 +92,14 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.VIEWPROFILE,
this._viewContact.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.up, this.messageArea.SELECTORS.CONTACT, this._selectPreviousContact.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.down, this.messageArea.SELECTORS.CONTACT, this._selectNextContact.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.up, this.messageArea.SELECTORS.VIEWCONVERSATION, this._selectPreviousConversation.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.down, this.messageArea.SELECTORS.VIEWCONVERSATION, this._selectNextConversation.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.up, this.messageArea.SELECTORS.CONTACT,
this._selectPreviousContact.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.down, this.messageArea.SELECTORS.CONTACT,
this._selectNextContact.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.up, this.messageArea.SELECTORS.VIEWCONVERSATION,
this._selectPreviousConversation.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.down, this.messageArea.SELECTORS.VIEWCONVERSATION,
this._selectNextConversation.bind(this));
this.messageArea.onDelegateEvent('focus', this.messageArea.SELECTORS.SEARCHBOX, this._setSearching.bind(this));
this.messageArea.onDelegateEvent('blur', this.messageArea.SELECTORS.SEARCHBOX, this._clearSearching.bind(this));

View File

@ -65,15 +65,21 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
this.messageArea.onCustomEvent(this.messageArea.EVENTS.CONVERSATIONSELECTED, this._viewMessages.bind(this));
this.messageArea.onCustomEvent(this.messageArea.EVENTS.SENDMESSAGE, this._viewMessages.bind(this));
this.messageArea.onCustomEvent(this.messageArea.EVENTS.CHOOSEMESSAGESTODELETE, this._chooseMessagesToDelete.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.SENDMESSAGE, this._sendMessage.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.STARTDELETEMESSAGES, this._startDeleting.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.DELETEMESSAGES, this._deleteMessages.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.SENDMESSAGE,
this._sendMessage.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.STARTDELETEMESSAGES,
this._startDeleting.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.DELETEMESSAGES,
this._deleteMessages.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.CANCELDELETEMESSAGES,
this._cancelMessagesToDelete.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.MESSAGE, this._toggleMessage.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.activate, this.messageArea.SELECTORS.MESSAGE,
this._toggleMessage.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.up, this.messageArea.SELECTORS.MESSAGE, this._selectPreviousMessage.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.down, this.messageArea.SELECTORS.MESSAGE, this._selectNextMessage.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.up, this.messageArea.SELECTORS.MESSAGE,
this._selectPreviousMessage.bind(this));
this.messageArea.onDelegateEvent(customEvents.events.down, this.messageArea.SELECTORS.MESSAGE,
this._selectNextMessage.bind(this));
this.messageArea.onDelegateEvent('focus', this.messageArea.SELECTORS.SENDMESSAGETEXT, this._setMessaging.bind(this));
this.messageArea.onDelegateEvent('blur', this.messageArea.SELECTORS.SENDMESSAGETEXT, this._clearMessaging.bind(this));
@ -474,10 +480,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* Check or uncheck the message if the message area is in editing mode.
*
* @params {event} e The jquery event
* @params {object} data Additional event data
* @private
*/
Messages.prototype._toggleMessage = function(e, data) {
Messages.prototype._toggleMessage = function(e) {
if (!this._isEditing()) {
return;
}

View File

@ -327,15 +327,17 @@ define(['jquery', 'theme_bootstrapbase/bootstrap', 'core/ajax', 'core/templates'
.done(function() {
// If everything executed correctly then update the DOM.
if (ischecked) {
button.attr('aria-checked', false)
button.attr('aria-checked', false);
button.attr('data-original-title', blockstring);
} else {
button.attr('aria-checked', true)
button.attr('aria-checked', true);
button.attr('data-original-title', unblockstring);
}
})
.fail(Notification.exception)
.always(function() { button.removeClass('loading') });
.always(function() {
button.removeClass('loading');
});
};
/**

View File

@ -431,17 +431,19 @@ define(['jquery', 'theme_bootstrapbase/bootstrap', 'core/ajax', 'core/templates'
.done(function() {
// If everything executed correctly then update the DOM.
if (ischecked) {
button.attr('aria-checked', false)
button.attr('aria-checked', false);
button.attr('data-original-title', disablestring);
$(document).trigger('messageprefs:enableall');
} else {
button.attr('aria-checked', true)
button.attr('aria-checked', true);
button.attr('data-original-title', enablestring);
$(document).trigger('messageprefs:disableall');
}
})
.fail(DebugNotification.exception)
.always(function() { button.removeClass('loading') });
.always(function() {
button.removeClass('loading');
});
};
/**

View File

@ -109,7 +109,7 @@ define(['jquery', 'core/custom_interaction_events', 'core_message/notification_p
$(document).on('messageprefs:enableall', function() {
this.setEnabled();
}.bind(this));
}
};
return PreferencesController;
});