mirror of
https://github.com/Kenshin/simpread.git
synced 2026-02-01 15:41:29 +00:00
Optimize focus controlbar logic.
This commit is contained in:
parent
b31408f417
commit
d436c8e65c
@ -61,7 +61,7 @@ function focuseMode() {
|
||||
$( "body" ).append( '<div class="ks-simpread-bg"></div>' );
|
||||
|
||||
// add control bar
|
||||
fcontrol.Init();
|
||||
fcontrol.Init( ".ks-simpread-bg" );
|
||||
|
||||
// click mask remove it
|
||||
$( ".ks-simpread-bg" ).on( "click", function( event ) {
|
||||
|
||||
@ -8,9 +8,11 @@ var fcontrol = ( function() {
|
||||
/*
|
||||
Add focus constrol bar
|
||||
*/
|
||||
FControl.prototype.Init = function() {
|
||||
FControl.prototype.Init = function( root ) {
|
||||
var me = this;
|
||||
$.get( chrome.extension.getURL( "/focus/template.html" ), function( tmpl ) {
|
||||
$( ".ks-simpread-bg" ).append( tmpl );
|
||||
me.constructor.prototype.$root = $(root);
|
||||
$( root ).append( tmpl );
|
||||
$target = $( ".ks-simpread-constrolbar" ).find( "span" );
|
||||
addStyle();
|
||||
addEventHandler();
|
||||
@ -49,7 +51,7 @@ var fcontrol = ( function() {
|
||||
break;
|
||||
case "closeicon":
|
||||
console.log("333")
|
||||
$(".ks-simpread-bg").click();
|
||||
FControl.prototype.$root.click();
|
||||
break;
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user