Created
October 15, 2018 09:40
-
-
Save ErikBernskiold/4482490c58918e8b7d51aef9e01cfa2a to your computer and use it in GitHub Desktop.
LoadingOverlay Helper Module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
/** | |
* Loading | |
* | |
* A loading indicator that can be activated for the entire | |
* website or on an element basis. | |
* | |
* Requires https://cdn.jsdelivr.net/npm/[email protected]/dist/loadingoverlay.min.js | |
*/ | |
export function loading() { | |
const LOADING_OVERLAY_OPTIONS = { | |
background: 'rgba(197, 0, 114, 0.9)', | |
imageColor: '#ffffff' | |
}; | |
return { | |
showForSite: function() { | |
jQuery.LoadingOverlay('show', LOADING_OVERLAY_OPTIONS); | |
}, | |
hideForSite: function() { | |
jQuery.LoadingOverlay('hide'); | |
}, | |
showForElement: function(element) { | |
jQuery(element).LoadingOverlay('show', LOADING_OVERLAY_OPTIONS); | |
}, | |
hideForElement: function(element) { | |
jQuery(element).LoadingOverlay('hide'); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment