mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Autosave: always expose the wp.autosave.local methods, fixes #28924.
git-svn-id: https://develop.svn.wordpress.org/trunk@29192 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -211,7 +211,7 @@ window.autosave = function() {
|
||||
var postData, compareString,
|
||||
result = false;
|
||||
|
||||
if ( isSuspended ) {
|
||||
if ( isSuspended || ! hasStorage ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -399,21 +399,15 @@ window.autosave = function() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Initialize and run checkPost() on loading the script (before TinyMCE init)
|
||||
blog_id = typeof window.autosaveL10n !== 'undefined' && window.autosaveL10n.blog_id;
|
||||
|
||||
// Check if the browser supports sessionStorage and it's not disabled
|
||||
if ( ! checkStorage() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the browser supports sessionStorage and it's not disabled,
|
||||
// then initialize and run checkPost().
|
||||
// Don't run if the post type supports neither 'editor' (textarea#content) nor 'excerpt'.
|
||||
if ( ! blog_id || ( ! $('#content').length && ! $('#excerpt').length ) ) {
|
||||
return;
|
||||
if ( checkStorage() && blog_id && ( $('#content').length || $('#excerpt').length ) ) {
|
||||
$document.ready( run );
|
||||
}
|
||||
|
||||
$document.ready( run );
|
||||
|
||||
return {
|
||||
hasStorage: hasStorage,
|
||||
getSavedPostData: getSavedPostData,
|
||||
|
||||
Reference in New Issue
Block a user