aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-09-06 20:32:08 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-09-06 22:00:46 +0530
commit54f7533673d7ada520ee25c2a8ecd6feab28252a (patch)
tree846ab4541218a5965c28d68bd03ac19f6b2cdf7b /src/stores
parentFix zoom actions executed on another services (#1875) (diff)
downloadferdium-app-54f7533673d7ada520ee25c2a8ecd6feab28252a.tar.gz
ferdium-app-54f7533673d7ada520ee25c2a8ecd6feab28252a.tar.zst
ferdium-app-54f7533673d7ada520ee25c2a8ecd6feab28252a.zip
Revert "refactor: trying to fix zoom in/out being sticky for the last active service when started up"
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/ServicesStore.js41
1 files changed, 1 insertions, 40 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index 9ee3effaa..75bc71388 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -99,9 +99,6 @@ export default class ServicesStore extends Store {
99 this.actions.service.openDevToolsForActiveService.listen( 99 this.actions.service.openDevToolsForActiveService.listen(
100 this._openDevToolsForActiveService.bind(this), 100 this._openDevToolsForActiveService.bind(this),
101 ); 101 );
102 this.actions.service.zoomInForActiveService.listen(this._zoomInForActiveService.bind(this));
103 this.actions.service.zoomOutForActiveService.listen(this._zoomOutForActiveService.bind(this));
104 this.actions.service.zoomResetForActiveService.listen(this._zoomResetForActiveService.bind(this));
105 this.actions.service.hibernate.listen(this._hibernate.bind(this)); 102 this.actions.service.hibernate.listen(this._hibernate.bind(this));
106 this.actions.service.awake.listen(this._awake.bind(this)); 103 this.actions.service.awake.listen(this._awake.bind(this));
107 this.actions.service.resetLastPollTimer.listen( 104 this.actions.service.resetLastPollTimer.listen(
@@ -965,45 +962,9 @@ export default class ServicesStore extends Store {
965 962
966 @action _openDevToolsForActiveService() { 963 @action _openDevToolsForActiveService() {
967 const service = this.active; 964 const service = this.active;
968 if (service) {
969 this._openDevTools({ serviceId: service.id });
970 } else {
971 debug('No service is active');
972 }
973 }
974
975 @action _zoomInForActiveService() {
976 const service = this.active;
977 if (service) {
978 debug(`active service : ${service.id}`);
979 const level = service.webview.getZoomLevel();
980 // level 9 =~ +300% and setZoomLevel wouldnt zoom in further
981 if (level < 9) {
982 service.webview.setZoomLevel(level + 1);
983 }
984 } else {
985 debug('No service is active');
986 }
987 }
988
989 @action _zoomOutForActiveService() {
990 const service = this.active;
991 if (service) {
992 debug(`active service : ${service.id}`);
993 const level = service.webview.getZoomLevel();
994 // level -9 =~ -50% and setZoomLevel wouldnt zoom out further
995 if (level > -9) {
996 service.webview.setZoomLevel(level - 1);
997 }
998 } else {
999 debug('No service is active');
1000 }
1001 }
1002 965
1003 @action _zoomResetForActiveService() {
1004 const service = this.active;
1005 if (service) { 966 if (service) {
1006 service.webview.setZoomLevel(0); 967 this._openDevTools({ serviceId: service.id });
1007 } else { 968 } else {
1008 debug('No service is active'); 969 debug('No service is active');
1009 } 970 }