mirror of
https://github.com/Kenshin/simpread.git
synced 2026-02-01 15:41:29 +00:00
Update dialog flow and logic.
This commit is contained in:
parent
aa658e43bf
commit
0b2ffda0f2
@ -22,7 +22,7 @@ export default class Dialog extends React.Component {
|
||||
// save dialog focus option
|
||||
save() {
|
||||
console.log( "dialog click submit button.", storage.current )
|
||||
storage.Set( STORAGE_MODE.focus );
|
||||
storage.Set( storage.current.mode );
|
||||
chrome.runtime.sendMessage({ type: "shortcuts" });
|
||||
new Notify().Render( 0, "更新成功!" );
|
||||
this.close( false );
|
||||
@ -33,9 +33,7 @@ export default class Dialog extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
let Option;
|
||||
if ( this.props.type == STORAGE_MODE.focus ) Option = FocusOpt;
|
||||
else Option = ReadOpt;
|
||||
const Option = this.props.type == STORAGE_MODE.focus ? FocusOpt : ReadOpt;
|
||||
return (
|
||||
<sr-dialog>
|
||||
<sr-dialog-content>
|
||||
@ -58,7 +56,7 @@ export default class Dialog extends React.Component {
|
||||
* Roll back when cancel button click
|
||||
*/
|
||||
function rollback() {
|
||||
storage.Restore( STORAGE_MODE.focus );
|
||||
storage.Restore( storage.current.mode );
|
||||
$( ".ks-simpread-bg" ).css({ "background-color" : storage.current.bgcolor });
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user