File tree Expand file tree Collapse file tree 7 files changed +24
-7
lines changed Expand file tree Collapse file tree 7 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"manifest_version" : 2 ,
3
3
"name" : " Quick Custom GSearch" ,
4
- "version" : " 0.7.3 " ,
4
+ "version" : " 0.7.5 " ,
5
5
"description" : " Quick access for custom search functions" ,
6
6
"page_action" : {
7
7
"default_icon" : " 19.png"
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ div.quick-custom-gsearch .language {
40
40
margin-top : 5px ;
41
41
}
42
42
43
- div .quick-custom-gsearch .term span .head ,
44
- div .quick-custom-gsearch .language span .head {
43
+ div .quick-custom-gsearch .term span .head ,
44
+ div .quick-custom-gsearch .language span .head {
45
45
height : 1.7em ;
46
46
display : block;
47
47
padding : 8px 0 0 6px ;
Original file line number Diff line number Diff line change 11
11
"webpack-cli" : " ^3.3.12"
12
12
},
13
13
"scripts" : {
14
- "start" : " yarn build:dev -- -w" ,
14
+ "start" : " webpack -d -w" ,
15
15
"lint" : " eslint --fix src/**/*.js" ,
16
16
"test" : " mocha -c --require test/setup.js test/**/*.spec.js" ,
17
17
"build:dev" : " webpack -d" ,
Original file line number Diff line number Diff line change @@ -32,6 +32,21 @@ const Add = () => {
32
32
return false ;
33
33
} ;
34
34
35
+ const CallOnscroll = ( ) => {
36
+ function fixing ( ) {
37
+ const e = document . querySelector ( '.quick-custom-gsearch' ) ;
38
+ const y = window . scrollY ;
39
+ if ( y > 90 ) {
40
+ e . style . position = 'fixed' ;
41
+ e . style . top = '70px' ;
42
+ } else {
43
+ e . style . position = 'absolute' ;
44
+ e . style . top = '159px' ;
45
+ }
46
+ }
47
+ window . onscroll = fixing ;
48
+ } ;
49
+
35
50
const Main = ( ) => {
36
51
const Observer = new MutationObserver ( ( ) => {
37
52
Add ( ) ;
@@ -42,6 +57,8 @@ const Main = () => {
42
57
Add ( ) ;
43
58
Observer . observe ( elm , { childList : true } ) ;
44
59
}
60
+
61
+ CallOnscroll ( ) ;
45
62
} ;
46
63
47
64
Main ( ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const MainView = {
10
10
return mainDiv ;
11
11
} ,
12
12
BindElement ( div ) {
13
- const ucs = document . querySelector ( 'div#ucs ' ) ;
13
+ const ucs = document . querySelector ( 'div#main ' ) ;
14
14
ucs . insertBefore ( div , ucs . firstChild ) ;
15
15
} ,
16
16
} ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const Model = require('./model.js');
2
2
3
3
const Parser = {
4
4
IsUCS ( ) {
5
- const ucs = document . querySelector ( 'div#ucs ' ) ;
5
+ const ucs = document . querySelector ( 'div#main ' ) ;
6
6
return ucs !== null ;
7
7
} ,
8
8
IsTextSearch ( ) {
You can’t perform that action at this time.
0 commit comments