I have a tabbar in my trigger.io app and currently have the setactive parameter set on the function element for each tab, so when selecting a tab it highlights the tab. While this works as expected I noticed if I go back using the back button on android or a built in soft button in app
( history.back() )
The highlight is lost. Now I understand why it would get lost as its only explicitly told to highlight when tapped but I was wondering if there is a way to programmatically trigger the highlight or active state so when I navigate between tabs and use the back button it will keep the highlighted state properly for each tab section?
Easiest would probably to add an event listener to update the button state with:
forge.event.backPressed.addListener(callback, error)
Also see: https://trigger.io/docs/current/api/core/event.html
Related
I know that I can trigger "Pause script execution" action in Google Chrome DevTools by having DevTools open with Sources tab active and press F8.
However, this seems to move focus out from the content area triggering additional events and I'm trying to debug some code that listens focus and blur events in addition to other events I'm trying to debug.
What I would really need is ability to trigger the "Pause script execution" feature without pressing F8. The closest I can do is executing setTimeout(function(){ debugger; }, 2000); in the JS console but that will stop all JS processing instantly after 2 second delay. The feature I'd like to use from DevTools is ability to delay stopping until some code actually runs so that the event queue already has the next events when scripting is stopped. (I'm basically trying to figure out what events are already in the queue in some specific situations and any extra focus/blur events will mess that work.)
Is there a way to trigger "Pause script execution" without pressing F8 or clicking the GUI button because both mess with the focus events?
It seems that to fully handle all combinations of keyboard focus and focus/blur events you need to do some extra steps. I found that I can get correct events like this:
Open DevTools and the Sources tab.
Press Ctrl+Shift+P to open "Run command" action
Search for focus and run command Emulate a focused page (note that this is not a permanent toggle and you need to do this again in the future to debug similar stuff).
Now prepare the situation you would want to test (e.g. you're about to press some keyboard button next).
Click the pause button within the DevTools Sources tab with the mouse.
Press Ctrl+Shift+P again and search for focus and run command Focus debuggee.
The keyboard focus is now in the correct place and any JS code that would be executed will trigger the debugger with the correct event for the next keyboard action.
If you need to debug mouse events, follow the same list but instead of clicking the pause button with mouse, press F8 twice (single press doesn't work for me?), then Ctrl+Shift+P again and search for "focus" and run command Focus debuggee using the keyboard only. Do not move the mouse even a single pixel after pressing F8 until you have exeuted the Focus debuggee command, or the page will see mousemove and other mouse movement related events.
I have the following conemu GuiMacro's defined
<F9> - Tab(3)
<F10> - Tab(2)
When I press the keys, I see the previous/next tab being highlighted in the tab bar, but the highlighted tab is not being activated - i.e. keyboard input remains in the current tab. I want F10 & F9 to work like CtrlTab and CtrlShiftTab - i.e. the contents of the new tab should be shown and it should receive keyboard input. How would I do that?
May be the Tab() GuiMacro function does what it's supposed to. Looks like there is a distinction between Tab and Console in ConEmu. To do what I want you need to switch console, not tab.
There is a simple workaround. Simply map F9 and F10 to the Switch next console and Switch previous console User hotkeys.
I have a "TabsPage" which is the first page of app. I use this.tabs.select(3) inside ionViewDidEnter of this page to select the 4th tab. This opens the 4th tab as the default tab but the div with class of .scroll-content doesn't have top margin so it goes up behind header. However if I use timeout like:
setTimeout(() => {
this.tabs.select(3);
}, 5000)
Everything seems okay when 4th tab is opened. What do you think the problem can be?
This sounds like an issue with your declaration of the type of life cycle event you are using. You declare the tab after the view has been created and I suspect there is a miscommunication between the firing of the tab select and the creation of the view itself ( that's why you are using a setTimeout() which is really hacky ) .
You can read up more on the life cycle events here under the section Lifecycle events
What you could try is to hit ionViewWillEnter(){} and set the tab without a timeout.
There is also a tab input property which you should be able to use in your tab tag.
<ion-tabs selectedIndex="3">
selectedIndex (number)
The default selected tab index when first loaded.
If a selected index isn't provided then it will use 0, the first tab.
Because the selected index is defined in the tabs components sitting in the view there should be no issues with view initialization of the tab.
I am looking for a way to navigate to a URL using a button in my Google Apps Script UiApp. I have added an on click server handler to the button, and once the event is triggered I would like to navigate to a different URL.
Is there a way I can do this in a server side handler ?
Many thanks
Relax_Im_A_Quant there is no way to have a server handler send the user to another URL. They have to click on a link.
However, there is a way to achieve similar results and may suit your needs.
You can add, remove and change the visibility of the elements in your UiApp.
For example, have a search box that starts visible and a results panel that starts not visible. When the server handler is called the search box is changed to not visible, the results panel changed to visible and the results are added to the results panel. You can turn off the visibility of a whole panel and turn on the visibility of a another.
In one of my apps that creates a document for the user, it would add a link to the document to the UiApp and then make it visible when the 'create document' button was pressed. It would prompt the user to click the link after it appeared -- taking them to the document (a new URL).
I'm doing a chrome extension which adds an option to right click menu in "page" context. I see the option added in the context menu after I click on extension's icon in the toolbar.
But I need the option to be added without clicking on the extension icon in the toolbar. If I add contextMenu creation code in the content script which gets injected in every page, the option is not added in the contextmenu.
What do I need to do to: add an option in the contextMenu when the user loads any webpage without clicking the extension first.
Add your context menu in the background page.
http://code.google.com/chrome/extensions/background_pages.html
Background pages is a single long-running script to manage some task or state. That is where you should put it.
Hope that helped.