mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 06:25:18 -04:00
Switch to deffered objects interface.
This commit is contained in:
parent
71d2ff10dc
commit
5fab8e1465
4 changed files with 26 additions and 25 deletions
|
@ -49,18 +49,18 @@ modulejs.define('ext/preview-txt', ['_', '$', 'markdown', 'core/settings', 'core
|
|||
preloadText = function (absHref, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: absHref,
|
||||
dataType: 'text',
|
||||
success: function (content) {
|
||||
url: absHref,
|
||||
dataType: 'text'
|
||||
})
|
||||
.done(function (content) {
|
||||
|
||||
callback(content);
|
||||
// setTimeout(function () { callback(content); }, 1000); // for testing
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
})
|
||||
.fail(function (jqXHR, textStatus, errorThrown) {
|
||||
|
||||
callback('[ajax error] ' + textStatus);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onEnter = function (items, idx) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue