add $.fn.indicateLoading for when you don't need to disable
we have $.fn.disableWhileLoading that is great for when you want to disable an element while a deferred (ajax request) is working. this is for when you just want to show a little loading icon, and is a lot lighter weight. Change-Id: I0271c9be9a5bb84e1faae5d94f09bac8a718c70e Reviewed-on: https://gerrit.instructure.com/16035 Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Clare Hetherington <clare@instructure.com> Reviewed-by: Sterling Cobb <sterling@instructure.com>
This commit is contained in:
parent
bb22a92259
commit
e886bf2d05
|
@ -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
|
|
@ -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
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 723 B |
Loading…
Reference in New Issue