|
Lines 36-42
KOHA.AJAX = {
Link Here
|
| 36 |
$( selector ) |
36 |
$( selector ) |
| 37 |
.attr( 'disabled', 'disabled' ) |
37 |
.attr( 'disabled', 'disabled' ) |
| 38 |
.each( function () { |
38 |
.each( function () { |
| 39 |
var $image = $( '<img src="/intranet-tmpl/prog/img/spinner-small.gif" alt="" class="spinner" />' ); |
39 |
var $spinner = $( '<span class="loading"></span>' ); |
| 40 |
var selector_type = this.localName; |
40 |
var selector_type = this.localName; |
| 41 |
if (selector_type === undefined) selector_type = this.nodeName; // IE only |
41 |
if (selector_type === undefined) selector_type = this.nodeName; // IE only |
| 42 |
switch ( selector_type.toLowerCase() ) { |
42 |
switch ( selector_type.toLowerCase() ) { |
|
Lines 48-61
KOHA.AJAX = {
Link Here
|
| 48 |
$( this ) |
48 |
$( this ) |
| 49 |
.data( 'original-text', $( this ).text ) |
49 |
.data( 'original-text', $( this ).text ) |
| 50 |
.text( text ) |
50 |
.text( text ) |
| 51 |
.before( $image ) |
51 |
.before( $spinner ) |
| 52 |
.bind( 'click.disabled', function () { return false; } ); |
52 |
.bind( 'click.disabled', function () { return false; } ); |
| 53 |
break; |
53 |
break; |
| 54 |
case 'button': |
54 |
case 'button': |
| 55 |
$( this ) |
55 |
$( this ) |
| 56 |
.data( 'original-text', $( this ).text() ) |
56 |
.data( 'original-text', $( this ).text() ) |
| 57 |
.text( text ) |
57 |
.text( text ) |
| 58 |
.prepend( $image ); |
58 |
.prepend( $spinner ); |
| 59 |
break; |
59 |
break; |
| 60 |
} |
60 |
} |
| 61 |
} ); |
61 |
} ); |
|
Lines 74-85
KOHA.AJAX = {
Link Here
|
| 74 |
$( this ) |
74 |
$( this ) |
| 75 |
.text( $( this ).data( 'original-text' ) ) |
75 |
.text( $( this ).data( 'original-text' ) ) |
| 76 |
.unbind( 'click.disabled' ) |
76 |
.unbind( 'click.disabled' ) |
| 77 |
.prevAll( 'img.spinner' ).remove(); |
77 |
.prevAll( 'span.loading' ).remove(); |
| 78 |
break; |
78 |
break; |
| 79 |
case 'button': |
79 |
case 'button': |
| 80 |
$( this ) |
80 |
$( this ) |
| 81 |
.text( $( this ).data( 'original-text' ) ) |
81 |
.text( $( this ).data( 'original-text' ) ) |
| 82 |
.find( 'img.spinner' ).remove(); |
82 |
.find( 'span.loading' ).remove(); |
| 83 |
break; |
83 |
break; |
| 84 |
} |
84 |
} |
| 85 |
} ) |
85 |
} ) |
| 86 |
- |
|
|