diff --git a/e107_web/js/core/all.jquery.js b/e107_web/js/core/all.jquery.js index 6a8e49c5b..05f1fedde 100644 --- a/e107_web/js/core/all.jquery.js +++ b/e107_web/js/core/all.jquery.js @@ -143,6 +143,10 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; method: $element.attr('data-method'), // Image to show loading. loading: $element.attr('data-loading'), + // FontAwesome icon name. + loadingIcon: $element.attr('data-loading-icon'), + // ID or class of container to place loading-icon within. eg. #mycontainer or .mycontainer + loadingTarget: $element.attr('data-loading-target'), // If this is a navigation controller, e.g. pager. nav: $element.attr('data-nav-inc'), // Old way - href='myscript.php#id-to-target. @@ -551,6 +555,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; } } + if(options.loadingIcon != null && options.loadingTarget != null) + { + var loadHtml = ''; + $(options.loadingTarget).html(loadHtml); + } // Old way - href='myscript.php#id-to-target. if(options.target == null || options.url == null) @@ -587,6 +596,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; data: data, complete: function () { + if(loadHtml) + { + $('.e-ajax-loading').hide(); + } + if($loadingImage) { $loadingImage.remove();