From b8a6beec402ec53d5353250be4390c42c4d9514b Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 19 Jul 2016 15:36:14 +0800 Subject: [PATCH] MDL-54687 core_message: removed loading template --- message/amd/src/contacts.js | 2 +- message/amd/src/messages.js | 2 +- message/amd/src/profile.js | 2 +- message/templates/loading.mustache | 34 ------------------- message/templates/message_popover.mustache | 2 +- .../notification_content_item.mustache | 2 +- .../templates/notification_popover.mustache | 2 +- 7 files changed, 6 insertions(+), 40 deletions(-) delete mode 100644 message/templates/loading.mustache diff --git a/message/amd/src/contacts.js b/message/amd/src/contacts.js index 927f2937222..6a32d36af64 100644 --- a/message/amd/src/contacts.js +++ b/message/amd/src/contacts.js @@ -141,7 +141,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification'], */ Contacts.prototype._loadContactArea = function(webservice) { // Show loading template. - templates.render('core_message/loading', {}).done(function(html, js) { + templates.render('core/loading', {}).done(function(html, js) { templates.replaceNodeContents("[data-region='contacts']", html, js); }); diff --git a/message/amd/src/messages.js b/message/amd/src/messages.js index c6e791fb8f4..cc2282364c8 100644 --- a/message/amd/src/messages.js +++ b/message/amd/src/messages.js @@ -63,7 +63,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification'], */ Messages.prototype._loadMessages = function(event, userid) { // Show loading template. - templates.render('core_message/loading', {}).done(function(html, js) { + templates.render('core/loading', {}).done(function(html, js) { templates.replaceNodeContents("[data-region='messages-area']", html, js); }); diff --git a/message/amd/src/profile.js b/message/amd/src/profile.js index 119ef224f2b..0bd52be60f6 100644 --- a/message/amd/src/profile.js +++ b/message/amd/src/profile.js @@ -62,7 +62,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' */ Profile.prototype._viewProfile = function(event, userid) { // Show loading template. - templates.render('core_message/loading', {}).done(function(html, js) { + templates.render('core/loading', {}).done(function(html, js) { templates.replaceNodeContents("[data-region='messages-area']", html, js); }); diff --git a/message/templates/loading.mustache b/message/templates/loading.mustache deleted file mode 100644 index 19dcd8438cf..00000000000 --- a/message/templates/loading.mustache +++ /dev/null @@ -1,34 +0,0 @@ -{{! - This file is part of Moodle - http://moodle.org/ - - Moodle is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Moodle is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Moodle. If not, see . -}} -{{! - @template core_message/loading - - Loading spinner shown while waiting for an ajax request - - Classes required for JS: - * None - - Data attibutes required for JS: - * None - - Context variables required for this template: - * None - - Example context (json): - { } -}} -{{#pix}}y/loading, core, {{#str}}loading, core_message{{/str}}{{/pix}} diff --git a/message/templates/message_popover.mustache b/message/templates/message_popover.mustache index e8b2d9250df..62151b76aec 100644 --- a/message/templates/message_popover.mustache +++ b/message/templates/message_popover.mustache @@ -54,7 +54,7 @@ data-original-title="{{#str}} markallread {{/str}}" aria-role="button"> {{#pix}} t/markasread, core, {{#str}} markallread {{/str}} {{/pix}} - {{#pix}} y/loading, core, {{#str}} loading, mod_assign {{/str}} {{/pix}} + {{> core/loading }}
{{#pix}} t/block {{/pix}}
-
{{> message/loading }}
+ {{> core/loading }} {{/preference}} {{/preferenceenabled}} diff --git a/message/templates/notification_popover.mustache b/message/templates/notification_popover.mustache index e13f0352701..43d4bb1fa64 100644 --- a/message/templates/notification_popover.mustache +++ b/message/templates/notification_popover.mustache @@ -59,7 +59,7 @@ data-original-title="{{#str}} markallread {{/str}}" aria-role="button"> {{#pix}} t/markasread, core, {{#str}} markallread {{/str}} {{/pix}} - {{#pix}} y/loading, core, {{#str}} loading, mod_assign {{/str}} {{/pix}} + {{> core/loading }}