diff --git a/app/coffeescripts/jquery/indicateLoading.coffee b/app/coffeescripts/jquery/indicateLoading.coffee new file mode 100644 index 00000000000..2ef045646f2 --- /dev/null +++ b/app/coffeescripts/jquery/indicateLoading.coffee @@ -0,0 +1,14 @@ +define [ + 'jquery' +], ($) -> + + # possible values for position are 'center' and 'after', see g_util_misc.sass + # passign a position is optional and if ommited will use 'center' + $.fn.indicateLoading = (position, deferred) -> + unless deferred? + deferred = position + position = 'center' + @each -> + $this = $(this).addClass 'loading ' + position + $.when(deferred).done -> + $this.removeClass 'loading ' + position \ No newline at end of file diff --git a/app/stylesheets/g_util_misc.sass b/app/stylesheets/g_util_misc.sass index d1b22367d99..8809b98ad0c 100644 --- a/app/stylesheets/g_util_misc.sass +++ b/app/stylesheets/g_util_misc.sass @@ -231,3 +231,16 @@ a.x-close-link color: black text-decoration: none +opacity(.60) + +.loading.after:after + width: image-width('ajax-loader-linear.gif') + height: image-height('ajax-loader-linear.gif') + background: url(/images/ajax-loader-linear.gif) + content: '' + display: inline-block + margin-left: 7px + +.loading.center + background-image: url(/images/ajax-loader-linear.gif) + background-position: center + background-repeat: no-repeat diff --git a/public/images/ajax-loader-linear.gif b/public/images/ajax-loader-linear.gif new file mode 100644 index 00000000000..21b7af079f8 Binary files /dev/null and b/public/images/ajax-loader-linear.gif differ