Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a loader image/text in Bootstrap X-editable

How can I put a loader gif in X-editable while an update request is made?

This is my code:

$(document).ready(function() {
    $('#username').editable();
});

<a href="#" id="username">superuser</a>

$('#username').editable({
    type: 'text',
    pk: 1,
    url: '/post',
    title: 'Enter username'
});
like image 972
Dinoop V P Avatar asked Oct 31 '22 16:10

Dinoop V P


1 Answers

X-editable comes with a loader gif by default.

Just make sure the loader gif is the following path:

/img/loading.gif

If you wish to provide a custom path to the loader.gif,

Modify the following lines in the editable-form.css file, line 42:

.editableform-loading {  
    background: url('../img/loading.gif') center center no-repeat;  
    ...
like image 200
Mysteryos Avatar answered Nov 08 '22 08:11

Mysteryos