MDL-54682 message: fix eslint issues

This commit is contained in:
Dan Poltawski 2016-10-11 13:29:56 +01:00
parent 34930e37cd
commit 412a4a6d8b
6 changed files with 6 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
define(["jquery","core/ajax","core/notification","core_message/message_notification_preference","core/custom_interaction_events"],function(a,b,c,d,e){var f={PREFERENCE:"[data-state]",PREFERENCES_CONTAINER:'[data-region="preferences-container"]',BLOCK_NON_CONTACTS:'[data-region="block-non-contacts-container"] [data-block-non-contacts]',BLOCK_NON_CONTACTS_CONTAINER:'[data-region="block-non-contacts-container"]'},g=function(b){this.root=a(b),this.registerEventListeners()};return g.prototype.preferencesDisabled=function(){return this.root.find(f.PREFERENCES_CONTAINER).hasClass("disabled")},g.prototype.saveBlockNonContactsStatus=function(){var d=this.root.find(f.BLOCK_NON_CONTACTS),e=this.root.find(f.BLOCK_NON_CONTACTS_CONTAINER),g=d.prop("checked");if(e.hasClass("loading"))return a.Deferred().resolve();e.addClass("loading");var h={methodname:"core_user_update_user_preferences",args:{preferences:[{type:d.attr("data-preference-key"),value:g?1:0}]}};return b.call([h])[0].fail(c.exception).always(function(){e.removeClass("loading")})},g.prototype.registerEventListeners=function(){e.define(this.root,[e.events.activate]),this.root.on(e.events.activate,f.BLOCK_NON_CONTACTS,function(a){this.saveBlockNonContactsStatus()}.bind(this)),this.root.on("change",function(b){if(!this.preferencesDisabled()){var c=a(b.target).closest(f.PREFERENCES_CONTAINER),e=a(b.target).closest(f.PREFERENCE),g=new d(c);e.addClass("loading"),g.save().always(function(){e.removeClass("loading")})}}.bind(this))},g});
define(["jquery","core/ajax","core/notification","core_message/message_notification_preference","core/custom_interaction_events"],function(a,b,c,d,e){var f={PREFERENCE:"[data-state]",PREFERENCES_CONTAINER:'[data-region="preferences-container"]',BLOCK_NON_CONTACTS:'[data-region="block-non-contacts-container"] [data-block-non-contacts]',BLOCK_NON_CONTACTS_CONTAINER:'[data-region="block-non-contacts-container"]'},g=function(b){this.root=a(b),this.registerEventListeners()};return g.prototype.preferencesDisabled=function(){return this.root.find(f.PREFERENCES_CONTAINER).hasClass("disabled")},g.prototype.saveBlockNonContactsStatus=function(){var d=this.root.find(f.BLOCK_NON_CONTACTS),e=this.root.find(f.BLOCK_NON_CONTACTS_CONTAINER),g=d.prop("checked");if(e.hasClass("loading"))return a.Deferred().resolve();e.addClass("loading");var h={methodname:"core_user_update_user_preferences",args:{preferences:[{type:d.attr("data-preference-key"),value:g?1:0}]}};return b.call([h])[0].fail(c.exception).always(function(){e.removeClass("loading")})},g.prototype.registerEventListeners=function(){e.define(this.root,[e.events.activate]),this.root.on(e.events.activate,f.BLOCK_NON_CONTACTS,function(){this.saveBlockNonContactsStatus()}.bind(this)),this.root.on("change",function(b){if(!this.preferencesDisabled()){var c=a(b.target).closest(f.PREFERENCES_CONTAINER),e=a(b.target).closest(f.PREFERENCE),g=new d(c);e.addClass("loading"),g.save().always(function(){e.removeClass("loading")})}}.bind(this))},g});

View File

@ -1 +1 @@
define(["jquery","core/ajax","core/notification","core/custom_interaction_events","core_message/notification_preference","core_message/notification_processor_settings"],function(a,b,c,d,e,f){var g={DISABLE_NOTIFICATIONS:'[data-region="disable-notification-container"] [data-disable-notifications]',DISABLE_NOTIFICATIONS_CONTAINER:'[data-region="disable-notification-container"]',PREFERENCE:"[data-state]",PREFERENCE_ROW:'[data-region="preference-row"]',PREFERENCE_INPUT:"[data-state] input",PROCESSOR_SETTING:"[data-processor-setting]"},h=function(b){this.root=a(b),this.userId=this.root.attr("data-user-id"),this.registerEventListeners()};return h.prototype.isDisabled=function(){return this.root.hasClass("disabled")},h.prototype.setDisabled=function(){this.root.addClass("disabled"),this.root.find(g.PREFERENCE_INPUT).prop("disabled",!0)},h.prototype.setEnabled=function(){this.root.removeClass("disabled"),this.root.find(g.PREFERENCE_INPUT).prop("disabled",!1)},h.prototype.toggleDisableAllStatus=function(){var d=a(g.DISABLE_NOTIFICATIONS),e=a(g.DISABLE_NOTIFICATIONS_CONTAINER),f=d.prop("checked");if(e.hasClass("loading"))return a.Deferred().resolve();e.addClass("loading");var h={methodname:"core_user_update_user_preferences",args:{userid:this.userId,emailstop:f?1:0}};return b.call([h])[0].done(function(){f?this.setDisabled():this.setEnabled()}.bind(this)).always(function(){e.removeClass("loading")}).fail(c.exception)},h.prototype.registerEventListeners=function(){var b=a(g.DISABLE_NOTIFICATIONS);d.define(this.root,[d.events.activate]),this.root.on("change",function(b){if(!this.isDisabled()){var c=a(b.target).closest(g.PREFERENCE),d=a(b.target).closest(g.PREFERENCE_ROW),f=new e(d,this.userId);c.addClass("loading"),f.save().always(function(){c.removeClass("loading")})}}.bind(this)),this.root.on(d.events.activate,g.PROCESSOR_SETTING,function(b){var c=a(b.target).closest(g.PROCESSOR_SETTING),d=new f(c);d.show()}),d.define(b,[d.events.activate]),b.on(d.events.activate,function(a){this.toggleDisableAllStatus()}.bind(this))},h});
define(["jquery","core/ajax","core/notification","core/custom_interaction_events","core_message/notification_preference","core_message/notification_processor_settings"],function(a,b,c,d,e,f){var g={DISABLE_NOTIFICATIONS:'[data-region="disable-notification-container"] [data-disable-notifications]',DISABLE_NOTIFICATIONS_CONTAINER:'[data-region="disable-notification-container"]',PREFERENCE:"[data-state]",PREFERENCE_ROW:'[data-region="preference-row"]',PREFERENCE_INPUT:"[data-state] input",PROCESSOR_SETTING:"[data-processor-setting]"},h=function(b){this.root=a(b),this.userId=this.root.attr("data-user-id"),this.registerEventListeners()};return h.prototype.isDisabled=function(){return this.root.hasClass("disabled")},h.prototype.setDisabled=function(){this.root.addClass("disabled"),this.root.find(g.PREFERENCE_INPUT).prop("disabled",!0)},h.prototype.setEnabled=function(){this.root.removeClass("disabled"),this.root.find(g.PREFERENCE_INPUT).prop("disabled",!1)},h.prototype.toggleDisableAllStatus=function(){var d=a(g.DISABLE_NOTIFICATIONS),e=a(g.DISABLE_NOTIFICATIONS_CONTAINER),f=d.prop("checked");if(e.hasClass("loading"))return a.Deferred().resolve();e.addClass("loading");var h={methodname:"core_user_update_user_preferences",args:{userid:this.userId,emailstop:f?1:0}};return b.call([h])[0].done(function(){f?this.setDisabled():this.setEnabled()}.bind(this)).always(function(){e.removeClass("loading")}).fail(c.exception)},h.prototype.registerEventListeners=function(){var b=a(g.DISABLE_NOTIFICATIONS);d.define(this.root,[d.events.activate]),this.root.on("change",function(b){if(!this.isDisabled()){var c=a(b.target).closest(g.PREFERENCE),d=a(b.target).closest(g.PREFERENCE_ROW),f=new e(d,this.userId);c.addClass("loading"),f.save().always(function(){c.removeClass("loading")})}}.bind(this)),this.root.on(d.events.activate,g.PROCESSOR_SETTING,function(b){var c=a(b.target).closest(g.PROCESSOR_SETTING),d=new f(c);d.show()}),d.define(b,[d.events.activate]),b.on(d.events.activate,function(){this.toggleDisableAllStatus()}.bind(this))},h});

View File

@ -646,10 +646,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
* Adjust the height of the messages area to match the changed height of
* the response area.
*
* @param {event} e The jquery event
* @private
*/
Messages.prototype._adjustMessagesAreaHeight = function(e) {
Messages.prototype._adjustMessagesAreaHeight = function() {
var messagesArea = this.messageArea.find(SELECTORS.MESSAGES);
var messagesResponse = this.messageArea.find(SELECTORS.MESSAGERESPONSE);

View File

@ -101,7 +101,7 @@ define(['jquery', 'core/ajax', 'core/notification',
CustomEvents.events.activate
]);
this.root.on(CustomEvents.events.activate, SELECTORS.BLOCK_NON_CONTACTS, function(e) {
this.root.on(CustomEvents.events.activate, SELECTORS.BLOCK_NON_CONTACTS, function() {
this.saveBlockNonContactsStatus();
}.bind(this));

View File

@ -153,7 +153,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/custom_interaction_eve
CustomEvents.events.activate
]);
disabledNotificationsElement.on(CustomEvents.events.activate, function(e) {
disabledNotificationsElement.on(CustomEvents.events.activate, function() {
this.toggleDisableAllStatus();
}.bind(this));
};