在Bootstrap X-editable中添加加载程序图像/文本

Din*_*V P 5 html ajax jquery twitter-bootstrap x-editable

在发出更新请求时,如何将加载程序gif放入X-editable?

这是我的代码:

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

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

$('#username').editable({
    type: 'text',
    pk: 1,
    url: '/post',
    title: 'Enter username'
});
Run Code Online (Sandbox Code Playgroud)

Mys*_*yos 2

X-editable 默认带有加载器 gif。

只需确保加载程序 gif 位于以下路径:

/img/loading.gif
Run Code Online (Sandbox Code Playgroud)

如果您希望提供 loader.gif 的自定义路径,

editable-form.css修改文件中的以下行line 42

.editableform-loading {  
    background: url('../img/loading.gif') center center no-repeat;  
    ...
Run Code Online (Sandbox Code Playgroud)