I would like to show my floating button in one Tab, how can I overcome that?
As #francesco-galgani wrote this is indeed the case. Instead of doing:
tabs.add("Tab Name", myContainer);
Do:
Container withFab = FloatingActionButton.bindFabToContainer(myContainer);
tabs.add("Tab Name", withFab);
Notice we now need to add the withFab container.
As #Shai Almong and #francesco-galgani
This will help one to sit the fab in the right position (Bottom right) in a specific tab
And give it a color you want using Styles
Container tabContainer = BorderLayout.center(new Label("tab content goes here");
FloatingActionButton myfab = FloatingActionButton.createFAB(FontImage.MATERIAL_ADD);
myfab.getStyle().setBgColor(ColorUtil.rgb(25, 118, 210));
Container withFab = BorderLayout.center(myfab.bindFabToContainer(tabContainer, Component.RIGHT, Component.BOTTOM));
UserRolesTabs.addTab("Tab Name", withFab);
Related
Someone was able to so quickly help me with a problem I'd spent hours and hours on, that I'm hoping I'll get lucky and someone can point me in the right direction on this one, too.
I didn't see anyone else with quite my issue here - and I'm new to working with WP templates instead of plain old HTML/CSS/JS stuff.
Basically - on a site we did (www.opted.org) with a purchased WP theme - I can't get the mobile version collapsible menu to stop defaulting on page load to the last item in the Main Menu.
So instead of something that makes sense - like About ASCO, or even being able to add "Select Page" - the drop down shows "-- past issues"
I don't care how I fix it really, but the client just doesn't want that page to be the default. I tried adding an extra menu item at the end called "Select Page" with an href='#' and using CSS to hide it on screens above 480px - but I couldn't get it to work no matter how I tried to refer to it.
I feel like this should be easy - but I don't know where to set the selected LI among the many WP files.
Thanks!!
I had a look at the plugin.js file on the site www.opted.org.
On line 22, there is 'header' : false // Boolean: Show header instead of the active item
and on line 41 there is jQuery('<option/>').text('Navigation')
Try setting line 22 to true, and text('Navigation') to your 'Select Page' if you prefer that over the text 'Navigation'
Or, according to the tinynav.js page (http://tinynav.viljamis.com/), you can customize that as an option like this:
$("#nav").tinyNav({
active: 'selected', // String: Set the "active" class
header: 'Navigation', // String: Specify text for "header" and show header instead of the active item
label: '' // String: Sets the <label> text for the <select> (if not set, no label will be added)
});
In your main.js file, your calling it on line 14. You should add that header: 'Navigation', option there.
It's hard to answer this question without knowing how the theme you are using works. However, you can certainly change the selected attribute using javascript.
Here's the code you would use to set it to 'About Asco' using jQuery:
jQuery('.tinynav').val('/about-asco/')
alternatively (a little clearer, but more verbose):
jQuery('.tinynav option:first').prop('selected', true);
I was under the impression that 'backgroundIamge' is supposed to be supported in .setStyleAttribute to allow the user to set a background image in a panel via something like this:
setStyleAttribute("backgroundImage","url('myImageUrl')");
However, when I try the following:
var panel = app.createVerticalPanel().setId('panel')
.setStyleAttribute('text-align', 'center')
.setStyleAttribute('zIndex', '3')
.setStyleAttribute('position', 'fixed')
.setStyleAttribute('left', 10)
.setStyleAttribute('top', 10)
.setWidth(250)
.setHeight(150)
.setStyleAttribute('backgroundImage',"url('https://myImage.png')");
I cannot produce a background image in the panel. The funny thing is the exact same code will produce a background image in a button. I have tried 'background' and 'background-image' as well to no avail. Is 'backgroundImage' NOT supported for panels or am I missing something?
I figured it out...you need to use createAbsolutePanel or add an empty label to other types of panels.
I'm stuck at this: I've created tabs and corresponding tabpanels. By default, I've hidden the tabs. To make a tab visible, I use this JavaScript line:
document.getElementById("tab-id").setAttribute("selected", true);
However, the content of the corresponding tabpanel does not update as I expected. I've tried using this:
document.getElementById("tabbox-id").selectedPanel = "tabpanel-id";
But nothing is happening; the content of the tabpanel is not updated.
Any assistance will be highly appreciated.
The selected attribute is set internally, it is merely an indicator that selection changed - changing it won't actually change selection. What you most likely want to do is this:
var tabpanel = document.getElementById("tabpanel-id");
document.getElementById("tabbox-id").selectedPanel = tabpanel;
Note that selectedPanel is the panel and not its ID. Alternatively you could also use selectedIndex:
document.getElementById("tabbox-id").selectedIndex = 1;
Documentation
I can't seem to find this.
What method (and constant) do I use to align the tabs in a JTabbedPane.
I Found how to switch between Top and Bottom. But I'm trying to put them in the center at the bottom.
So that it looks like this
ooooooooooooooooooo
o..................................o
o..................................o
o..................................o
o..................................o
ooooooooooooooooooo
...... |Tab1||Tab2|
Thanks
You can't. This layout rule is enforced by the selected look and feel.
You can write your own UI-Delegate for JTabbedPane component that extends BasicTabbedPane class and overwrite the
method 'getTabInsets(int, int)'. Change value of 'tabInsets' atribute ( default value is: new Insets(0,4,1,4), centered).
I want to find and replace functionality in contentEditable div. I want to add one toolbar in which one find and replace button placed. when one press this button then one popup window open and ask for keyword to search when keyword is given then it will find only in given div id not whole document and highlight it.
Is this jquery plugin what you are looking for?
You can call it like this:
jQuery(function()
{
var options =
{
exact:"exact",
keys:"lorem ispum"
}
$("#myDiv").SearchHighlight(options);
});