mirror of
https://github.com/Kenshin/simpread.git
synced 2026-02-01 15:41:29 +00:00
Add storage.VerifyCur().
This commit is contained in:
parent
c1099dbabc
commit
af6e257854
@ -61,7 +61,9 @@ function focuseMode() {
|
||||
sel, range, node, tag,
|
||||
target;
|
||||
|
||||
if ( (storage.current.mode && storage.current.mode != mode.focus) || $.isEmptyObject( storage.current )) storage.Setcur( mode.focus );
|
||||
if ( storage.VerifyCur( mode.focus ) ) {
|
||||
storage.Setcur( mode.focus );
|
||||
}
|
||||
target = selector( storage.current.site.include );
|
||||
|
||||
// uniqueness verification
|
||||
@ -118,5 +120,7 @@ function fixFocus( $focus ) {
|
||||
*/
|
||||
function readMode() {
|
||||
console.log( "=== simpread read mode active ===" )
|
||||
if ( (storage.current.mode && storage.current.mode != mode.read ) || $.isEmptyObject( storage.current )) storage.Setcur( mode.read );
|
||||
if ( storage.VerifyCur( mode.read ) ) {
|
||||
storage.Setcur( mode.read );
|
||||
}
|
||||
}
|
||||
@ -162,6 +162,15 @@ class Storage {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verity current changed
|
||||
*
|
||||
* @param {string} @see mode
|
||||
*/
|
||||
VerifyCur( type ) {
|
||||
return ( current.mode && current.mode != type ) || $.isEmptyObject( current );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user